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

[IA-4839] [DO NOT MERGE] Terra on Azure (ToA) base jupyter docker image #483

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 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 Oct 11, 2023
82c8ec9
remove opt/conda jupyter path
LizBaldo Oct 12, 2023
d5dc18a
use nbclassic instead of notebook to maintain backward compatibility …
LizBaldo Oct 12, 2023
1efe5a5
do not install notebook extensions anymore - should not be necessary …
LizBaldo Oct 12, 2023
6c42c84
better jupyter creation best practice, sudo permissions, and conda in…
LizBaldo Oct 25, 2023
9863460
this seems to work well on my BEE so saving it
LizBaldo Oct 26, 2023
9075907
latest backup
LizBaldo Oct 27, 2023
9a63654
use nbclassic to stay backward compatible with js extensions
LizBaldo Nov 1, 2023
0d4096e
working image with jupyter in base and user virtual environment
LizBaldo Apr 10, 2024
b3b1a28
isolating jupyter env instead of user venv
LizBaldo Apr 10, 2024
3a2ff3f
fixing conda env name display in jupyter terminal
LizBaldo Apr 11, 2024
2f7f7b4
adding smoke test, updating gha versions, and adding a readme
LizBaldo Apr 11, 2024
cfd2af2
try not running as root but granting sudo priviledges to jupyter user
LizBaldo Apr 16, 2024
7c1da78
addressing dockerfile comments
LizBaldo Apr 18, 2024
a72f84e
change jupyter-user uid and make run-jupyter.sh executable
LizBaldo Apr 24, 2024
2be78da
specify notebook dir and change ownership to jupyter user
LizBaldo May 2, 2024
333085b
only focus on changes for the new image
LizBaldo May 29, 2024
4f6da7d
more cleanup
LizBaldo May 29, 2024
ae65b98
try to ignore the platform flag when looking for base images
LizBaldo May 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
node_version: [8, 10, 12]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout current code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}

Expand All @@ -36,7 +36,7 @@ jobs:
python-version: '3.10'

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/test-terra-base-jupyter.yml
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"
Comment on lines +81 to +89
Copy link
Contributor

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 use docker compose to set this up for the next person working on this?

Copy link
Collaborator Author

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

4 changes: 2 additions & 2 deletions .github/workflows/test-terra-jupyter-aou.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -53,7 +53,7 @@ jobs:
run: sudo rm -rf /usr/share/dotnet

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-terra-jupyter-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -53,7 +53,7 @@ jobs:
run: sudo rm -rf /usr/share/dotnet

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-terra-jupyter-bioconductor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -53,7 +53,7 @@ jobs:
run: sudo rm -rf /usr/share/dotnet

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-terra-jupyter-gatk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -53,7 +53,7 @@ jobs:
run: sudo rm -rf /usr/share/dotnet

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-terra-jupyter-hail.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -53,7 +53,7 @@ jobs:
run: sudo rm -rf /usr/share/dotnet

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-terra-jupyter-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -55,7 +55,7 @@ jobs:
run: sudo rm -rf /usr/share/dotnet

- id: auth
uses: google-github-actions/auth@v1
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.TD_GCP_SA_KEY }}
create_credentials_file: true
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ package-lock.json
.python_history
.keras/
.ammonite/
.metals/
.metals/
.venv/
Loading
Loading