-
Notifications
You must be signed in to change notification settings - Fork 34
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
[IA-4839] [DO NOT MERGE] Terra on Azure (ToA) base jupyter docker image #483
Open
LizBaldo
wants to merge
19
commits into
master
Choose a base branch
from
IA-4839-toa-base-image
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
fabcdaf
original attempt at creating a leaner terra base docker image
LizBaldo 82c8ec9
remove opt/conda jupyter path
LizBaldo d5dc18a
use nbclassic instead of notebook to maintain backward compatibility …
LizBaldo 1efe5a5
do not install notebook extensions anymore - should not be necessary …
LizBaldo 6c42c84
better jupyter creation best practice, sudo permissions, and conda in…
LizBaldo 9863460
this seems to work well on my BEE so saving it
LizBaldo 9075907
latest backup
LizBaldo 9a63654
use nbclassic to stay backward compatible with js extensions
LizBaldo 0d4096e
working image with jupyter in base and user virtual environment
LizBaldo b3b1a28
isolating jupyter env instead of user venv
LizBaldo 3a2ff3f
fixing conda env name display in jupyter terminal
LizBaldo 2f7f7b4
adding smoke test, updating gha versions, and adding a readme
LizBaldo cfd2af2
try not running as root but granting sudo priviledges to jupyter user
LizBaldo 7c1da78
addressing dockerfile comments
LizBaldo a72f84e
change jupyter-user uid and make run-jupyter.sh executable
LizBaldo 2be78da
specify notebook dir and change ownership to jupyter user
LizBaldo 333085b
only focus on changes for the new image
LizBaldo 4f6da7d
more cleanup
LizBaldo ae65b98
try to ignore the platform flag when looking for base images
LizBaldo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Test terra-base-jupyter | ||
# Perform smoke tests on the terra-base-jupyter Docker image to have some amount of confidence that | ||
# Python package versions are compatible. | ||
# | ||
# To configure the minimal auth needed for these tests to be able to read public data from Google Cloud Platform: | ||
# Step 1: Create a service account per these instructions: | ||
# https://github.com/google-github-actions/setup-gcloud/blob/master/setup-gcloud/README.md | ||
# Step 2: Give the service account the following permissions within the project: BigQuery User | ||
# Step 3: Store its key and project id as GitHub repository secrets TD_GCP_SA_KEY and GCP_PROJECT_ID. | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
paths: | ||
- 'terra-base-jupyter/**' | ||
- '.github/workflows/test-terra-base-jupyter.yml' | ||
|
||
push: | ||
# Note: GitHub secrets are not passed to pull requests from forks. For community contributions from | ||
# regular contributors, its a good idea for the contributor to configure the GitHub actions to run correctly | ||
# in their fork as described above. | ||
# | ||
# For occasional contributors, the dev team will merge the PR fork branch to a branch in upstream named | ||
# test-community-contribution-<PR#> to run all the GitHub Action smoke tests. | ||
branches: [ 'test-community-contribution*' ] | ||
paths: | ||
- 'terra-base-jupyter/**' | ||
- '.github/workflows/test-terra-base-jupyter.yml' | ||
|
||
workflow_dispatch: | ||
# Allows manually triggering of workflow on a selected branch via the GitHub Actions tab. | ||
# GitHub blog demo: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/. | ||
|
||
env: | ||
GOOGLE_PROJECT: ${{ secrets.GCP_PROJECT_ID }} | ||
|
||
jobs: | ||
|
||
test_docker_image: | ||
runs-on: self-hosted | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Free up some disk space | ||
run: sudo rm -rf /usr/share/dotnet | ||
|
||
- id: auth | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
credentials_json: ${{ secrets.TD_GCP_SA_KEY }} | ||
create_credentials_file: true | ||
|
||
- name: Set up Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v0.3.0 | ||
with: | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
|
||
- name: Build Docker image and base images too, if needed | ||
run: | | ||
gcloud auth configure-docker | ||
./build_smoke_test_image.sh terra-base-jupyter | ||
|
||
- name: Upload workflow artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: notebook-execution-results | ||
path: terra-base-jupyter/tests/*.html | ||
retention-days: 30 | ||
|
||
- name: Test Python code with pytest | ||
run: | | ||
chmod a+r "${{ steps.auth.outputs.credentials_file_path }}" | ||
docker run \ | ||
--env GOOGLE_PROJECT \ | ||
--volume "${{ steps.auth.outputs.credentials_file_path }}":/tmp/credentials.json:ro \ | ||
--env GOOGLE_APPLICATION_CREDENTIALS="/tmp/credentials.json" \ | ||
--volume $GITHUB_WORKSPACE/terra-base-jupyter/tests:/tests \ | ||
--workdir=/tests \ | ||
--entrypoint="" \ | ||
terra-base-jupyter:smoke-test \ | ||
/bin/sh -c "pip3 install pytest; pytest" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,5 @@ package-lock.json | |
.python_history | ||
.keras/ | ||
.ammonite/ | ||
.metals/ | ||
.metals/ | ||
.venv/ |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
would it be possible to either drop this into a
scripts/run tests
(or something like this) and/or in combination usedocker compose
to set this up for the next person working on this?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.
Yep, I would love to brainstorm that with you because that might slightly fall outside of this PR scope. But the question here is how can we easily test these docker images? I am not convinced that the current GHAs that we have is the way to go