Skip to content

build: added environment.lock for 'stable' builds#75

Merged
jandom merged 8 commits intomainfrom
jandom/2025-12/build/improved-environment-lock
Dec 18, 2025
Merged

build: added environment.lock for 'stable' builds#75
jandom merged 8 commits intomainfrom
jandom/2025-12/build/improved-environment-lock

Conversation

@jandom
Copy link
Collaborator

@jandom jandom commented Dec 15, 2025

Summary

When using environment.yaml, conda may resolve to different package builds at different times. This PR creates a new docker image just to create a hermetic conda environment: taking in environment.yml and producing environment.lock (just for linux for now).

Big change: new conda environment openfold3 instead of base, which gets auto-activated.

update @jnwei and I discussed this and we want to do pinning for the 'stable' image but not for the tests or the development image. I need to re-think a bit how that's put together. This approach will give us the best of both worlds: people who consume the docker image for inference get exactly the correct deps, while developers have a more library-like dependency experience.

Changes

  • create a new Dockerfile.update-reqs
  • update the Dockerfile to use the environment.lock instead of environment.yml
  • other minor changes

Related Issues

  • N/A

Testing

Other Notes

None

@jandom jandom requested a review from jnwei December 15, 2025 12:00
@jandom jandom self-assigned this Dec 15, 2025
@jandom jandom changed the title Jandom/2025 12/build/improved environment lock build: improved environment.lock Dec 15, 2025
@@ -1,5 +1,5 @@
# Full performance multi-stage build with complete CUDA toolchain
ARG CUDA_BASE_IMAGE_TAG=12.2.2-cudnn8-devel-ubuntu22.04
ARG CUDA_BASE_IMAGE_TAG=12.1.1-cudnn8-devel-ubuntu22.04
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is unrelated and snuck in via #70, turning back to the old version we used

@jandom jandom marked this pull request as ready for review December 15, 2025 15:50
@jandom jandom changed the title build: improved environment.lock build: added environment.lock for 'stable' builds Dec 16, 2025
@jandom jandom marked this pull request as draft December 16, 2025 15:06
@jandom jandom marked this pull request as ready for review December 17, 2025 12:31
Copy link
Contributor

@jnwei jnwei left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adding the option to pin environments while leaving the CI testing environment flexible.

I just have a few minor comments and questions.

FROM nvidia/cuda:${CUDA_BASE_IMAGE_TAG} AS builder

# Environment mode: "lock" for reproducible builds, "yaml" for flexible dev builds
ARG BUILD_MODE=lock
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to provide a default option for this argument? There are some users who may prefer to use the Dockerfile directly to build their own image, rather than use the publishsed Dockerfile image, so it would be nice to have a default argument here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey, yeah i think this already contains the default, but it probably should be 'yaml' instead of 'lock'
The non-default version of this is just

ARG BUILD_MODE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is fixed now

@@ -1,35 +1,75 @@
## Production images
## Updating the production.lock file

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add documentation about where the current production.lock is generated? Specifically, what kind of instance / system, and any other variables that are relevant to environment resolution.

For my understanding: Do we expect the production.lock to change if the system is a GPU / CPU? Or should it be the same because we specify the same docker base image with CUDA?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's a good point – currently the updating and generation is kind of synonymous (it doesn't say that). And it absolutely is platform specific, as you mentioned in your comments later. Yeah, it's specific to the platform (linux64, arm64, etc). The GPU/CPU point is conditional on what's in the environment.yaml – if that pulls a CPU-version of torch, that's what will be installed in the env.

https://conda.anaconda.org/conda-forge/linux-64/zstd-1.5.7-hb78ec9c_6.conda#4a13eeac0b5c8e5b8ab496e6c4ddd829
https://conda.anaconda.org/conda-forge/linux-64/aws-c-io-0.23.3-had5c4f5_4.conda#a53c9f532e5c4a2b85d4b4c439ea5a5d
https://conda.anaconda.org/conda-forge/linux-64/brotli-bin-1.2.0-hb03c661_1.conda#af39b9a8711d4a8d437b52c1d78eb6a1
https://conda.anaconda.org/conda-forge/linux-64/cuda-cudart-12.4.127-he02047a_2.conda#a748faa52331983fc3adcc3b116fe0e4
Copy link
Contributor

Choose a reason for hiding this comment

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

just curious - why do we have two versions of cudart in the lockfile? Do they come from different dependencies?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ha, really great question – i don't know! :D But here is what claude had to say

Screenshot 2025-12-18 at 09 36 37

https://conda.anaconda.org/pytorch/noarch/pytorch-mutex-1.0-cuda.tar.bz2#a948316e36fb5b11223b3fcfa93f8358
https://conda.anaconda.org/conda-forge/noarch/tzdata-2025c-h8577fbf_0.conda#338201218b54cadff2e774ac27733990
https://conda.anaconda.org/conda-forge/noarch/ca-certificates-2025.11.12-hbd8a1cb_0.conda#f0991f0f84902f6b6009b4d2350a83aa
https://conda.anaconda.org/conda-forge/noarch/cuda-cudart_linux-64-12.4.127-h85509e4_2.conda#329163110a96514802e9e64d971edf43
Copy link
Contributor

Choose a reason for hiding this comment

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

the other cudart dependency

@jandom jandom merged commit 3095901 into main Dec 18, 2025
5 checks passed
@jandom jandom deleted the jandom/2025-12/build/improved-environment-lock branch December 18, 2025 11:42
jnwei pushed a commit that referenced this pull request Jan 27, 2026
* Update production.lock

* feat: use .lock files instead of environment.yml which may drift

* use a dedicated conda env and auto-activate it

* move to "deny-all, allow-list" in dockerignore

* test: with the environment.lock we can take a fresher version of miniforge

* support building both from .lock and .yaml

* change default to 'yaml'

* review comments: make the platform explicit
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