-
Notifications
You must be signed in to change notification settings - Fork 48
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
Use HEAD versions in presubmit CI #782
Changes from all commits
b73aaaf
9e4557a
ca30d1f
7556a3a
3e8f56c
b148ef8
f97c1ca
98f4ea7
f687a7f
95532c2
8783894
82d16c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,23 @@ pushd /opt/pip-tools.d | |
# twice | ||
pip-compile -o requirements.pre $(ls requirements-*.in) | ||
|
||
IFS=$'\n' | ||
for line in $(cat requirements.pre | egrep '^[^#].+ @ git\+' || true); do | ||
# VCS installs are of the form "PACKAGE @ git+..." | ||
PACKAGE=$(echo "$line" | awk '{print $1}') | ||
ref=$(yq e ".${PACKAGE}.latest_verified_commit" ${MANIFEST_FILE}) | ||
echo "${line}@${ref}" | ||
# Find the VCS installs, which are of the form | ||
# PACKAGE @ git+GIT_REPO_URL | ||
for line in $(sed -n -e 's/^\([^#].*\) @ git+\(.*\)$/\1=\2/p' requirements.pre); do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did the regex expression change? I do understand the logic afterwards (19:27) but just not how records in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before: it was just extracting |
||
PACKAGE="${line%=*}" | ||
REPO_URL="${line#*=}" | ||
ref=$(yq e ".${PACKAGE}.commit" ${MANIFEST_FILE}) | ||
if [[ "${ref}" == "null" ]]; then | ||
# If a commit wasn't pinned in the manifest, get the latest version of the | ||
# default branch of $REPO_URL, pin it, and write it to the manifest. | ||
ref=$(git ls-remote --exit-code "${REPO_URL}" HEAD | awk '{ print $1 }') | ||
touch /opt/manifest.d/pip-finalize.yaml | ||
yq -i e ".${PACKAGE}.commit = \"${ref}\"" /opt/manifest.d/pip-finalize.yaml | ||
yq -i e ".${PACKAGE}.mode = \"pip-vcs\"" /opt/manifest.d/pip-finalize.yaml | ||
yq -i e ".${PACKAGE}.url = \"${REPO_URL}\"" /opt/manifest.d/pip-finalize.yaml | ||
fi | ||
echo "${PACKAGE} @ git+${REPO_URL}@${ref}" | ||
done | tee requirements.vcs | ||
unset IFS | ||
|
||
# Second pip-compile includes one more requirements file that pins all vcs installs | ||
# Uses a special env var to let our custom pip impl know to treat the following as | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,8 +21,8 @@ on: | |
BUMP_MANIFEST: | ||
type: boolean | ||
description: Bump git repos in manifest.yaml to head of tree? | ||
default: false | ||
required: false | ||
default: true | ||
required: true | ||
MERGE_BUMPED_MANIFEST: | ||
type: boolean | ||
description: "(used if BUMP_MANIFEST=true) If true: attempt to PR/merge manifest branch" | ||
|
@@ -88,7 +88,11 @@ jobs: | |
id: manifest-branch | ||
shell: bash -x -e {0} | ||
run: | | ||
BUMP_MANIFEST=${{ github.event_name == 'schedule' || inputs.BUMP_MANIFEST || 'false' }} | ||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
BUMP_MANIFEST="${{ inputs.BUMP_MANIFEST }}" | ||
else | ||
BUMP_MANIFEST="true" | ||
fi | ||
MERGE_BUMPED_MANIFEST=${{ github.event_name == 'schedule' || inputs.MERGE_BUMPED_MANIFEST || 'false' }} | ||
# Prepend nightly manifest branch with "z" to make it appear at the end | ||
if [[ "$BUMP_MANIFEST" == "true" ]]; then | ||
|
@@ -155,15 +159,15 @@ jobs: | |
# converts manifest yaml to a json object of {SOFTWARE_NAME: URL#REF, ...} | ||
urlrefs=$( | ||
cat .github/container/manifest.yaml |\ | ||
yq -o=json 'to_entries | .[] | select(.value.mode == "git-clone") | {( .key | upcase | sub("-", "_") ): .value.url + "#" + .value.latest_verified_commit}' |\ | ||
yq -o=json 'to_entries | .[] | select(.value.mode == "git-clone") | {( .key | upcase | sub("-", "_") ): "URLREF_" + ( .key | upcase | sub("-", "_") ) + "=" + .value.url + "#" + .value.commit}' |\ | ||
jq -c -s 'add' | ||
) | ||
# SOURCE_OVERRIDES is a comma-separated list of package=urlref pairs | ||
IFS=, read -ra overrides <<< "${{ inputs.SOURCE_OVERRIDES }}" | ||
for override in "${overrides[@]}"; do | ||
PACKAGE=$(cut -d= -f 1 <<< "${override}" | tr '[:lower:]' '[:upper:]' | tr '-' '_') | ||
URLREF=$(cut -d= -f 2- <<< "${override}") | ||
urlrefs=$(echo "$urlrefs" | jq -c ". + {\"$PACKAGE\": \"$URLREF\"}") | ||
urlrefs=$(echo "$urlrefs" | jq -c ". + {\"$PACKAGE\": \"URLREF_${PACKAGE}=$URLREF\"}") | ||
Comment on lines
165
to
+170
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @olupton , can you walk me through the idea of how manifest.yaml and If I want to install FLAX on an older commit, I have two options: I can change the manifest.yaml, or use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the idea here is that there are two modes. First, when you're using this machinery to test some feature or fix, you don't particularly want to commit/push to JAX-Toolbox, so you can inject your feature/fix branch using Second, when you are preparing a release, you gradually want to converge on a fixed and reproducible set of versions. In that case, you would take some seed Ultimately I don't see why you would want to mix the two modes, and the second one ought to be pedantic. In mode one, you default to taking the HEAD and recording what that was. In mode two, forgetting to specify a version of something should maybe be an error. |
||
done | ||
echo "SOURCE_URLREFS=${urlrefs}" >> $GITHUB_OUTPUT | ||
|
||
Comment on lines
172
to
173
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong, but you suggest to use default values for jax
ref#commit
from Dockerfile rather than from manifest file?What is the scenario for NGC release? Update Dockerfiles accordingly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely yes for the normal CI: by default we take the Dockerfile defaults, which is basically "HEAD".
When preparing releases, one option (noted here: #782 (comment)) is to commit a manifest file to the release branch and use that. Your suggestion of changing the default values in the Docker files in the release branches would also work, I think, and would require less machinery (to translate manifest --> URLREF build arg) but might be a little more tedious to seed at the beginning of the release process.
cc: @terrykong @ko3n1g