fix: resolve Dockerfile not found in containerized edxapp sandbox builds - #365
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Jenkins sandbox provisioning scripts to stop relying on an in-repo Dockerfile inside edx-platform (which no longer exists) by building from the edx/public-dockerfiles edx-platform.Dockerfile and by using explicit :lms / :cms image tags during LMS/CMS provisioning and runtime steps.
Changes:
- Build the edx-platform base image using
edx/public-dockerfilesinstead of expectingDockerfilein the checked-outedx-platformrepo. - Build LMS/CMS images via the private overlay Dockerfile, tagging outputs as
edx-platform:lms/edx-platform:cms(and re-tagging:latestto LMS for compatibility). - Update worker provisioning to reuse the existing edx-platform image when available, otherwise build from the public Dockerfile.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| util/jenkins/worker-container-provisioner.sh | Reuses an existing edx-platform image (or builds from public-dockerfiles) to avoid relying on an in-repo Dockerfile. |
| util/jenkins/app-container-provisioner.sh | Switches LMS/CMS base build to the public edx-platform Dockerfile and updates runtime steps to use :lms / :cms tags. |
| util/jenkins/ansible-provision.sh | Adjusts LMS/CMS provisioning variables/tags, but currently includes unresolved merge conflict markers. |
Suppressed comments (2)
util/jenkins/ansible-provision.sh:978
- Unresolved merge conflict markers will cause this script to error before provisioning edx-exams. Resolve the conflict and keep the quoted secret-id form to avoid word-splitting issues.
<<<<<<< Updated upstream
app_git_ssh_key=$(aws secretsmanager get-secret-value --region "${region}" --secret-id "${configuration_secure_secret}" --query SecretString --output text | jq -r '._local_git_identity')
=======
app_git_ssh_key=$(aws secretsmanager get-secret-value --region "${region}" --secret-id $configuration_secure_secret --query SecretString --output text | jq -r '._local_git_identity')
>>>>>>> Stashed changes
util/jenkins/ansible-provision.sh:1006
- Unresolved merge conflict markers will cause this script to error before provisioning subscriptions. Resolve the conflict and keep the quoted secret-id form to avoid word-splitting issues.
<<<<<<< Updated upstream
app_git_ssh_key=$(aws secretsmanager get-secret-value --region "${region}" --secret-id "${configuration_secure_secret}" --query SecretString --output text | jq -r '._local_git_identity')
=======
app_git_ssh_key=$(aws secretsmanager get-secret-value --region "${region}" --secret-id $configuration_secure_secret --query SecretString --output text | jq -r '._local_git_identity')
>>>>>>> Stashed changes
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
util/jenkins/app-container-provisioner.sh:82
EDX_PLATFORM_VERSIONis expanded into the generated script without quotes. If${app_version}ever contains whitespace or shell-glob characters, thedocker buildcommand can receive a split/mangled build-arg value and fail or build the wrong ref. Quote the build-arg value to keep it intact.
docker build \
-f /tmp/edx-platform.Dockerfile \
--target base \
--build-arg EDX_PLATFORM_REPO=edx/edx-platform \
--build-arg EDX_PLATFORM_VERSION=${app_version} \
--secret id=GIT_AUTH_TOKEN,env=GITHUB_TOKEN \
util/jenkins/app-container-provisioner.sh:73
- The base/overlay image builds rely on
GITHUB_TOKENbeing present (used as the BuildKitGIT_AUTH_TOKENsecret). If the token is missing from Secrets Manager, the script will proceed and fail later with a less actionable Docker/Git error. Consider failing fast with a clear message when the token is empty.
set +x
export GITHUB_TOKEN='${app_github_token}'
set -x
| configuration_secure_json=$(aws secretsmanager get-secret-value --region "${region}" --secret-id "${configuration_secure_secret}" --query SecretString --output text) | ||
| app_git_ssh_key=$(echo "$configuration_secure_json" | jq -r '._local_git_identity // empty') | ||
| # Required by internal edx-platform-private Dockerfile (BuildKit GIT_AUTH_TOKEN) to fetch | ||
| # private repos such as edx-internal and edx-themes over HTTPS. | ||
| app_github_token=$(echo "$configuration_secure_json" | jq -r '.GITHUB_TOKEN // .github_access_token // .github_token // empty') |
Summary
Jira - GSRE-4332
Purpose
Containerized sandbox image builds looked for
Dockerfileinside the cloned edx-platform repo. That file was removed from edx-platform, so Docker build failed and CreateSandbox could not finish LMS/CMS (and worker) provisioning. This change removes that dependency so the build can succeed again.Changes
public-dockerfilesedx-platform.Dockerfileedx-platform:lms/edx-platform:cmstags for LMS/CMS run/compose steps