Skip to content

Commit

Permalink
updated to sdk 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
keighrim committed Jul 24, 2023
1 parent 648cea3 commit 55ba8af
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
.git/
.github/
.gitignore
.dockerignore
Dockerfile
Containerfile
bin/
build/
*~
**/*.pyc
**/__pyche__
.dockerignore
ContainerFile
outerdemo.sh
wgbh-audios/
demo/results/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-apps-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- opened
- transferred
pull_request:
pull_request_target:
types:
- opened

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-close.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
issues:
types:
- closed
pull_request:
pull_request_target:
types:
- closed

Expand Down
10 changes: 9 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
FROM ghcr.io/clamsproject/clams-python-ffmpeg-tf2:1.0.2
# Use the same base image version as the clams-python python library version
FROM ghcr.io/clamsproject/clams-python-ffmpeg-tf2:1.0.9
# See https://github.com/orgs/clamsproject/packages?tab=packages&q=clams-python for more base images
# IF you want to automatically publish this image to the clamsproject organization,
# 1. you should have generated this template without --no-github-actions flag
# 1. to add arm64 support, change relevant line in .github/workflows/container.yml
# * NOTE that a lots of software doesn't install/compile or run on arm64 architecture out of the box
# * make sure you locally test the compatibility of all software dependencies before using arm64 support
# 1. use a git tag to trigger the github action. You need to use git tag to properly set app version anyway

################################################################################
# DO NOT EDIT THIS SECTION
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

This is a CLAMS app that wraps [Brandeis-ACS](https://pypi.org/project/brandeis-acs/) tool.

General user instruction for CLAMS apps is available at [CLAMS Apps documentation](https://apps.clams.ai/clamsapp/).
## User instruction

General user instructions for CLAMS apps is available at [CLAMS Apps documentation](https://apps.clams.ai/clamsapp).
18 changes: 9 additions & 9 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import argparse
import logging
import os
import tempfile
from typing import Union, Dict

import bacs
from clams import ClamsApp, Restifier
from mmif import Mmif, View, Document, AnnotationTypes, DocumentTypes
from typing import Union, Dict

import metadata
import bacs


class BrandeisAcs(ClamsApp):
Expand Down Expand Up @@ -88,21 +88,21 @@ def run_bacs(self, files: list) -> (list, list):

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
"--port", action="store", default="5000", help="set port to listen"
)
parser.add_argument("--port", action="store", default="5000", help="set port to listen" )
parser.add_argument("--production", action="store_true", help="run gunicorn server")
# more arguments as needed
# add more arguments as needed
# parser.add_argument(more_arg...)

parsed_args = parser.parse_args()

# create the app instance
app = BrandeisAcs()

http_app = Restifier(app, port=int(parsed_args.port)
)
http_app = Restifier(app, port=int(parsed_args.port))
# for running the application in production mode
if parsed_args.production:
http_app.serve_production()
# development mode
else:
app.logger.setLevel(logging.DEBUG)
http_app.run()
7 changes: 5 additions & 2 deletions metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
DO NOT CHANGE the name of the file
"""
import re
from clams.app import ClamsApp
from clams.appmetadata import AppMetadata
from mmif import DocumentTypes, AnnotationTypes

Expand Down Expand Up @@ -44,5 +45,7 @@ def appmetadata() -> AppMetadata:
# DO NOT CHANGE the main block
if __name__ == '__main__':
import sys

sys.stdout.write(appmetadata().jsonify(pretty=True))
metadata = appmetadata()
for param in ClamsApp.universal_parameters:
metadata.add_parameter(**param)
sys.stdout.write(metadata.jsonify(pretty=True))
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
clams-python==1.0.2
clams-python==1.0.9
brandeis-acs==1.11

0 comments on commit 55ba8af

Please sign in to comment.