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

Auto Generate environment.yml #339

Closed
wants to merge 44 commits into from

Conversation

TimothyWillard
Copy link
Contributor

Describe your changes.

This pull request adds a script called build/create_environment_yml.R to generate a consistent conda environment.yml file that can be used to install the rest of flepiMoP into. It also runs this script in a GitHub action that will automatically regenerate the file when one of the dependencies has changed.

What does your pull request address? Tag relevant issues.

This pull request takes another step towards GH-191 by extracting the conda environment file portion of GH-329's build/hpc_install.sh into it's own thing.

Tag relevant team members.

n/a at the moment, draft PR

TimothyWillard and others added 30 commits September 13, 2024 12:27
Heavily inspired by the original `batch/slurm_init.sh` script. The init
script is a run once script that takes care of installation of
dependencies and setup whereas prerun sets env vars needed per a run.
Initial version of the HPC install script, some what inspired by the
slurm init script.
* Changed how the R arrow version is formatted for readability.
* Changed the final output command to print diagnostic info correctly.
Added slurm's --partition flag to the `batch/inference_job_launcher.py`
script for usage on UNC's Longleaf cluster.
The longleaf specific init/pre-run scripts are now surpassed by the
generic `build/hpc_install.sh` script.
Remove the --partition flag for the slurm partition to use from the
inference job launcher script. This will be handled in a new
flepiscripts script.
* Changed `flepiMoP` git clone to use ssh instead of http to allow for
  edits from HPC.
* Add `set -e` to error clearly on a command failure.
* Install `gempyor` from cloned `flepiMoP` repo directly, yet to do the
  same for R packages.
Swapped out manual install from GitHub with the `build/setup.R` script
which handles a few dependencies and installs CLIs as executables.
In light of disucssion about how directories are structured on longleaf
split out the project path into a work directory. Still need to do the
same for rockfish, for now assuming work and user dirs are the same
there.
* Keep the work directory as where project is supposed to go.
* Move flepiMoP source and conda env to $HOME.
Out sourced the per run setup into `build/flepi_init.sh` so users are
not forced to update/reinstall just to run.
Use `devtools::install` for `install.packages` for better handling of
source package installs.
The install script throws unexpected warnings about being unable to
install arrow, even though arrow is already installed by conda.
The `inference::install_cli` function now installs to the bin folder provided by the conda environment.

Co-authored-by: Carl A. B. Pearson <[email protected]>
Users now must call the init script themselves.
TimothyWillard and others added 14 commits October 9, 2024 13:23
Moved R dependencies install from individually for each of the custom R
packages into the conda environment. This should alleviate warnings
relating to arrow install and streamline the install of R dependencies.
Add an explicit call to `inference::install_cli()` after flepiMoP custom
R packages.
The covidcast package is not available through conda-forge, so has to be
installed through CRAN.
* Downgrade R to 4.3 to resolve r-MMWRweek.
* Correct directory change and missing repo errors.
Custom R script to generate a consistent conda `environment.yml` file.
* Added dnachun to the channels for osx-arm64 builds of r-truncnorm and
  r-ggraph.
* Added an explicit r-sf dependency for covidcast that has to be
  installed manually outside of the environment file.
* Bug fix to check if file exists before comparing.
Custom GitHub action to run the `build/create_environment_yml.R` script
and then add those changes to a pull request if there are any.
Change the ref from a particular commit to the branch of the PR so the
HEAD is attached.
Make it clear that the commit is made by a GitHub action by putting that
in the commit message title.
@jcblemai
Copy link
Collaborator

Any reason for PR close while keeping the branch ? Hard to do ? or something for later

@TimothyWillard TimothyWillard deleted the GH-191/auto-generate-environment.yml branch October 11, 2024 12:05
@TimothyWillard
Copy link
Contributor Author

No, just forgot to do so while working on this yesterday.

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.

3 participants