diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a889964ecfa75bbf4fba50dd4cca045f59bc9e1d..16d1c1b36ff5331181a9bcf87387f6f8a908eff9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,7 +10,6 @@ stages: - pages - build - build_develop - # - deploy pep8: before_script: @@ -71,23 +70,11 @@ build_image: build_develop: stage: build_develop image: "docker:18.09.7" - only: - - fix + except: + - master script: - - docker build -t $CI_REGISTRY_IMAGE:fix . + - docker build -t $CI_REGISTRY_IMAGE:dev . - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker push $CI_REGISTRY_IMAGE:fix + - docker push $CI_REGISTRY_IMAGE:dev + -# deploy: -# stage: deploy -# before_script: -# - "" -# image: -# name: clarinpl/kubectl -# only: -# - master -# script: -# - envsubst < config.ini > config.temp.ini -# - envsubst < deployment.yaml > deployment.temp.yaml -# - kubectl --kubeconfig=$KUBECONFIG --namespace=nlpworkers create configmap punctuator-config-ini --from-file=config.ini=config.temp.ini --dry-run -o yaml | kubectl apply -f - -# - kubectl --kubeconfig=$KUBECONFIG --namespace=nlpworkers apply -f deployment.temp.yaml diff --git a/README.md b/README.md index 8af02823493ea1eebfe20fb567809cc578e80675..7625a5254d5f08b451336eb3e269e2793a571164 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ A service that automatically adds punctuation and casing to raw word-stream (eg. ## Config ```ini -[deployment] +[tool] s3_endpoint = https://s3.clarin-pl.eu models_s3_location=s3://workers/punctuator/models_2_0 models_cache_dir=/home/worker/models diff --git a/config.ini b/config.ini index e00cefeb5db0f566b67638fc2f904a42b1f8c282..8a5266e7347e528fa16702eb08559323eaa0ca3e 100644 --- a/config.ini +++ b/config.ini @@ -8,16 +8,14 @@ queue_prefix = nlp_ [tool] workers_number=1 - -[logging] -port=9981 -local_log_level=INFO - -[deployment] s3_endpoint = https://s3.clarin-pl.eu models_s3_location=s3://workers/punctuator/models_2_0 models_cache_dir=/home/worker/models languagetool_cache_dir=/home/worker/languagetool max_context_size=256 overlap=20 -device=cpu \ No newline at end of file +device=cpu + +[logging] +port=9981 +local_log_level=INFO \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml deleted file mode 100644 index eb2190ed7a3313b4db74e05add4fdc934fa00140..0000000000000000000000000000000000000000 --- a/deployment.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: punctuator - labels: - app: punctuator - namespace: nlpworkers -spec: - replicas: 1 - selector: - matchLabels: - app: punctuator - template: - metadata: - labels: - app: punctuator - spec: - containers: - - name: punctuator - image: clarinpl/$CI_PROJECT_NAME:latest - imagePullPolicy: Always - volumeMounts: - - name: config - mountPath: /home/worker/config.ini - subPath: config.ini - - name: samba - mountPath: /samba - - name: models - mountPath: /home/worker/models/ - volumes: - - name: config - configMap: - name: punctuator-config-ini - - name: samba - hostPath: - path: /samba - type: "" - - name: models - hostPath: - path: /tmp/punctuator-models - type: DirectoryOrCreate - diff --git a/entrypoint.py b/entrypoint.py index 923f19c8b1308662e247e53c55a9355b4c8f29d4..268740c15c707580eb5b696be7f4409e18943024 100755 --- a/entrypoint.py +++ b/entrypoint.py @@ -7,11 +7,11 @@ import sys parser = configparser.ConfigParser() parser.read("config.ini") -s3_endpoint = parser["deployment"].get("s3_endpoint", "https://s3.clarin-pl.eu") -s3_location = parser["deployment"].get( +s3_endpoint = parser["tool"].get("s3_endpoint", "https://s3.clarin-pl.eu") +s3_location = parser["tool"].get( "models_s3_location", "s3://workers/punctuator/models_2_0" ) -local_models_location = parser["deployment"].get("models_cache_dir", "/tmp/models") +local_models_location = parser["tool"].get("models_cache_dir", "/tmp/models") cmd = ( f'aws --no-sign-request --endpoint-url "{s3_endpoint}" s3 sync --delete' diff --git a/worker.py b/worker.py index 33109baaee5e3a873efc7ce883a8984fe7880d97..28fe681f0187d1af937f066c4182c76650dc91d3 100644 --- a/worker.py +++ b/worker.py @@ -12,7 +12,7 @@ class Worker(nlp_ws.NLPWorker): def init(self): config = configparser.ConfigParser() config.read("config.ini") - config = config["deployment"] + config = config["tool"] models_cache_dir = config.get("models_cache_dir", "/home/worker/models") languagetool_cache_dir = config.get( @@ -33,7 +33,7 @@ class Worker(nlp_ws.NLPWorker): def perform_fast_test(): config = configparser.ConfigParser() config.read("config.ini") - config = config["deployment"] + config = config["tool"] models_cache_dir = config.get("models_cache_dir", "/home/worker/models") languagetool_cache_dir = config.get(