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

Update ingest CLI to support scheduled ingest #1103

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

pkalita-lbl
Copy link
Collaborator

Re: #1079

These changes are in support of having a cron job in Rancher for periodic automated ingests. The idea is that cron job will use the existing server Docker image to do an ingest via the existing nmdc-server CLI. Typically when we initiate an ingest manually we do so via the API with a POST /api/jobs/ingest request. I'm proposing not using the API for the automated ingest because 1) the /api/jobs/ingest endpoint requires authentication and that would be challenging without persistent API authentication tokens and 2) we would probably need to add an additional endpoint to check on the job status after is has been finished in order to poll for success or failure.

The changes here move the guts of the ingest celery task to a separate plain function (do_ingest) that can be called by both the celery task and the CLI to ensure they do the same operations. It also adds a --swap-rancher-secrets to the ingest CLI. If used, it will use the Rancher API to do the A/B database swap and redeploy the server and worker workloads. A number of environment variables need to be set in order to use that flag.

Copy link
Collaborator

@naglepuff naglepuff left a comment

Choose a reason for hiding this comment

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

LGTM!

@pkalita-lbl pkalita-lbl merged commit 74c7be9 into main Jan 5, 2024
2 checks passed
@pkalita-lbl pkalita-lbl deleted the issue-1079-ingest-cli branch January 5, 2024 21:00
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.

2 participants