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

Add slash command /condalock to autogenerate conda-lock files #5

Merged
merged 4 commits into from
Nov 28, 2022

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Nov 25, 2022

To enable easier reproducibility of conda environments, create an automated way of refreshing conda-lock files by writing /condalock as as slash command in Pull Request comments.

Related to CryoInTheCloud/CryoCloudWebsite#1 (comment)

Based on:

TODO setup auth tokens for automated commits, based on GenericMappingTools/pygmt#646 (comment)

To enable easier reproducibility of conda environments, create an automated way of refreshing conda-lock files by writing `/condalock` as as slash command in Pull Request comments. Also briefly documented all the GitHub Actions workflows in `.github/workflows/README.md`.
@weiji14 weiji14 self-assigned this Nov 25, 2022
@github-actions
Copy link

Binder 👈 Test this PR on Binder

@weiji14
Copy link
Member Author

weiji14 commented Nov 25, 2022

@yuvipanda, I've just created a cryointhecloud-bot GitHub App and have sent a request to transfer it to the CryoInTheCloud GitHub org. That GitHub App will be used to make git commits when conda-lock files are refreshed, similar to https://github.com/pangeo-bot (but the GitHub App isn't a user account, just a machine user). If you can approve that request, that would be great 🙏

After that, we'll need to set the APP_ID and APP_PRIVATE_KEY secrets in this repo. See if you can add those in based on the GitHub App, or if someone can grant me access, I can add them in too.

@yuvipanda
Copy link
Contributor

@weiji14 you should have access now!

@weiji14
Copy link
Member Author

weiji14 commented Nov 25, 2022

Cool, thanks Yuvi! Let me do some testing to see if it works.

Let the `git ls-files` pick up new files (like `conda-linux-64.lock`) too. Also changed command-line arguments to long-form for better readability.
To be updated by the condalock slash command later.
@weiji14
Copy link
Member Author

weiji14 commented Nov 25, 2022

Yay, it works! Tested this on a personal fork (since the workflow needs to be tested with the GitHub Actions files being already on the main branch).

So I wrote the /condalock command at weiji14#3 (comment), which kicked off a GitHub Actions workflow at https://github.com/weiji14/hub-image/actions/runs/3551298148/jobs/5965359133#step:6:14, and the bot successfully updated the conda-lock files at weiji14@e16f6b6!

@yuvipanda
Copy link
Contributor

@weiji14 great! Wanna merge and test?

@weiji14
Copy link
Member Author

weiji14 commented Nov 28, 2022

Sure! Right now this is only generating the 'old' explicit lockfile from conda-lock<1.0 (conda-linux-64.lock) instead of the newer unified lockfile (conda-lock.yml). The old explicit lockfile is compatible with conda/mamba and repo2docker but doesn't include the pip dependencies, whereas the newer unified lockfile contains both conda/pip dependencies but can't be used by repo2docker (yet). Just noting this for future reference.

@weiji14 weiji14 merged commit fc4e3e1 into main Nov 28, 2022
@weiji14 weiji14 deleted the slash-command-condalock branch November 28, 2022 20:35
weiji14 added a commit that referenced this pull request Dec 4, 2022
Update instructions on how to add or update dependencies in the
cryocloud docker image. Specifically, documenting the `/condalock` slash
command added in #5 which runs
[`conda-lock`](https://github.com/conda-incubator/conda-lock) for
creating snapshots of fully reproducible conda environments.
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