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

Deployment documentation #427

Merged
merged 32 commits into from
Sep 18, 2019
Merged

Deployment documentation #427

merged 32 commits into from
Sep 18, 2019

Conversation

gusmith
Copy link
Contributor

@gusmith gusmith commented Sep 11, 2019

Main changes:

  • adding CELERYD_CONCURRENCY environment variable
  • updating the helm charts and template to include a lot of required which should help debugging a deployment if not working
  • include some comments about recommended configurations

Before asking for review, need to deploy it for tests.

@gusmith gusmith self-assigned this Sep 11, 2019
Copy link
Collaborator

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrequested review :-P

backend/entityservice/settings.py Outdated Show resolved Hide resolved
deployment/entity-service/Chart.yaml Show resolved Hide resolved
deployment/entity-service/README.md Outdated Show resolved Hide resolved
@@ -0,0 +1,29 @@
Few helm tips:

To check if the provided values are sufficient, remove/delete the `Charts` folder and run:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To check if the provided values are sufficient, remove/delete the `Charts` folder and run:
To check that all necessary values have been provided before deployment run:

Can this point at a released chart? e.g. something like lint my-values.yaml data61/anonlink-service==1.12?

Point out why the linter doesn't work with sub charts - is there an alternative to deleting the Charts folder if a user is deploying "properly" from our data61 chart repo with:

helm install data61/entity-service [--values...]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not have the impression it can point to a released chart. The help:

This command takes a path to a chart and runs a series of tests to verify that
the chart is well-formed.

And when simply running helm lint from a random folder:

$ helm lint
==> Skipping .
No chart found for linting (missing Chart.yaml)

Error: 0 chart(s) linted, 1 chart(s) failed

which shows that it is searching for a Chart.yaml.

Guillaume Smith added 12 commits September 12, 2019 17:00
 - by default, we do not have persistent volume claims (like that, doing `helm delete --purge` removes all the created resources)
 - by default, ingress is disabled (do not open the service to the oustide of the cluster, as may require domain name, certificates and all)
 - by default, request only one "normal" worker
It is already the default value file.
Create too much redundancy and hard to find documentation.
@gusmith
Copy link
Contributor Author

gusmith commented Sep 16, 2019

With all these changes, the default values.yaml file should be a minimal deployment.
I tested it, and run well.
Next step would be to create a new repository made specifically for the helm template/charts, instead of keeping it here. It will include splitting well the documentation too.

@gusmith gusmith mentioned this pull request Sep 17, 2019
@gusmith
Copy link
Contributor Author

gusmith commented Sep 17, 2019

The force-push was to remove two commits at the end which shouldn't have been directly in this PR.
I opened a new PR #429 because two tests were sometime failing because of timing issues: one was simply timing out, for the other one, the database update was taking longer to observe the error.

Copy link
Collaborator

@hardbyte hardbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should make debugging a deployment easier!

@@ -77,6 +77,9 @@ spec:
secretKeyRef:
name: {{ template "es.fullname" . }}
key: minioSecretKey
# Flask should get access to more connections if required. It is often asking for run status directly into the database.
- name: DATABASE_MAX_CONNECTIONS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be in the config map as FLASK_DB_MAX_CONNECTIONS instead of being the only non secret config passed in as an env var.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created FLASK_DB... and CELERY_DB_... env vars.

@@ -5,39 +5,65 @@ metadata:
labels:
{{- include "es.release_labels" . | indent 4 }}
data:
DEBUG: {{ required "workers.debug is required." .Values.workers.debug | quote }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I think we should be transitioning away from using debug

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, even more seeing how much work was done on the log file.

## Maximum number of tasks a pool worker process can execute before it’s replaced with a new one
## Low number is recommended, otherwise the celery workers may exhaust the available memory and threads.
## Cf issue https://github.com/data61/anonlink-entity-service/issues/410
MAX_TASKS_PER_CHILD: "30"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is much much lower than 4096

deployment/entity-service/values.yaml Outdated Show resolved Hide resolved
@gusmith gusmith merged commit 6ba4af2 into develop Sep 18, 2019
@gusmith gusmith deleted the deployment-documentation branch September 18, 2019 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants