Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding pmanagement config information #35

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions environment_examples/local_env_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,14 @@ export REDIS_PASSWORD=$(kubectl get secret --namespace default redis-release -o
export REDIS_HOST="redis-release-master.default.svc.cluster.local"
export REDIS_PORT=6379

#PMANAGEMENT
export PMANAGEMENT_CONFIG_VERSION=1.1
export PMANAGEMENT_PROOFREADING_TABLE = "proofreading_status_public_v1"
export PMANAGEMENT_PROOFREADINGREVIEW_TABLE = "proofreading_review_public_v1"
export PMANAGEMENT_PROOFREADINGREVIEW_TEST_TABLE = "proofreading_review_public_vtest"
export PMANAGEMENT_NEURONINFORMATION_TABLE = "neuron_information_v2"
export PMANAGEMENT_NEURONINFORMATION_TEST_TABLE = "neuron_information_vtest"
export PMANAGEMENT_DATASTORE_BUCKET_PATH = {{ pmanagement_datastore_bucket_path }}

# CELERY
export CELERY_WORKER_POOL="celery-pool"
Expand Down
1 change: 1 addition & 0 deletions environment_examples/render_local_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def create_spaced_list_of_strings(l):
"mat_datastacks": "datastack1,datastack2",
"mat_beat_schedule": "{ENV_REPO_PATH}/my_mat_schedule.json",
"pcg_graph_ids": "pcg_table1,pcg_table2",
"pmanagement_datastore_bucket_path": "gs://my_bucket",
"authservice_secret_key": "randomkey",
"global_server": "global.my-dns.com",
"guidebook_csrf_key": "random_key",
Expand Down
2 changes: 1 addition & 1 deletion kubetemplates/meshing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
name: cpu
target:
type: Utilization
averageUtilization: 100
averageUtilization: 80
---
kind: Service
apiVersion: v1
Expand Down
82 changes: 60 additions & 22 deletions kubetemplates/pmanagement.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: proofreadingmanagement-config-v${PMANAGEMENT_CONFIG_VERSION}
namespace: default
data:
config.cfg: |
DEBUG = False
TESTING = False
HOME = os.path.expanduser("~")
CORS_ORIGINS = "*"
CORS_HEADERS = "Content-Type"
SECRET_KEY = "b${DASH_SECRET_KEY}"

LOGGING_FORMAT = '{"source":"%(name)s","time":"%(asctime)s","severity":"%(levelname)s","message":"%(message)s"}'
LOGGING_DATEFORMAT = "%Y-%m-%dT%H:%M:%S.0Z"
LOGGING_LEVEL = logging.DEBUG
JSON_SORT_KEYS = False
datastack_name = "${MAT_DATASTACKS}"
proofreading_table_name = "${PMANAGEMENT_PROOFREADING_TABLE}"
review_table_name = "${PMANAGEMENT_PROOFREADINGREVIEW_TABLE}"
review_test_table_name = "${PMANAGEMENT_PROOFREADINGREVIEW_TEST_TABLE}"
cell_identity_table_name = "${PMANAGEMENT_NEURONINFORMATION_TABLE}"
cell_identity_test_table_name = "${PMANAGEMENT_NEURONINFORMATION_TEST_TABLE}"
server_address = "https://${GLOBAL_SERVER}"
datastore_namespace = os.environ.get("DATASTORE_NAMESPACE", "pmanagement")

datastore_kind = "proofreading_drive"
datastore_project_id = "${PROJECT_NAME}"
pcg_ids = [${PCG_GRAPH_IDS}]
PCG_ADDRESS = "http://pychunkedgraph-service/segmentation/api/v1/table/"
DATASTORE_BUCKET_PATH="${PMANAGEMENT_DATASTORE_BUCKET_PATH}"
---
apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
Expand Down Expand Up @@ -53,6 +86,9 @@ spec:
- name: google-cloud-key
secret:
secretName: ${PMANAGEMENT_SERVICE_ACCOUNT_SECRET}
- name: proofreadingmanagement-config-volume
configMap:
name: proofreadingmanagement-config-v${PMANAGEMENT_CONFIG_VERSION}
terminationGracePeriodSeconds: 10
containers:
- name: pmanagement
Expand All @@ -63,6 +99,8 @@ spec:
volumeMounts:
- name: google-cloud-key
mountPath: /home/nginx/.cloudvolume/secrets
- name: proofreadingmanagement-config-volume
mountPath: /app/proofreadingmanagement/app/instance/
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /home/nginx/.cloudvolume/secrets/${GOOGLE_SECRET_FILENAME}
Expand Down Expand Up @@ -137,27 +175,27 @@ spec:
jobTemplate:
spec:
template:
spec:
spec:
volumes:
- name: google-cloud-key
secret:
secretName: ${PMANAGEMENT_SERVICE_ACCOUNT_SECRET}
- name: google-cloud-key
secret:
secretName: ${PMANAGEMENT_SERVICE_ACCOUNT_SECRET}
containers:
- name: tallyedits
image: ${DOCKER_REPOSITORY}/proofreadingmanagement:v${PMANAGEMENT_VERSION}
imagePullPolicy: Always
args:
- bash
- -c
- python tallyedits/cron_job.py
volumeMounts:
- name: google-cloud-key
mountPath: /home/nginx/.cloudvolume/secrets
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /home/nginx/.cloudvolume/secrets/${GOOGLE_SECRET_FILENAME}
- name: DAF_CREDENTIALS
value: /home/nginx/.cloudvolume/secrets/${CAVE_SECRET_FILENAME}
- name: PCG_GRAPH_IDS
value: ${PCG_GRAPH_IDS}
restartPolicy: OnFailure
- name: tallyedits
image: ${DOCKER_REPOSITORY}/proofreadingmanagement:v${PMANAGEMENT_VERSION}
imagePullPolicy: Always
args:
- bash
- -c
- python tallyedits/cron_job.py
volumeMounts:
- name: google-cloud-key
mountPath: /home/nginx/.cloudvolume/secrets
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /home/nginx/.cloudvolume/secrets/${GOOGLE_SECRET_FILENAME}
- name: DAF_CREDENTIALS
value: /home/nginx/.cloudvolume/secrets/${CAVE_SECRET_FILENAME}
- name: PCG_GRAPH_IDS
value: ${PCG_GRAPH_IDS}
restartPolicy: OnFailure