-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from uc-cdis/feat/stata-base-update
HP-1776 Feat/stata base update
- Loading branch information
Showing
17 changed files
with
125 additions
and
136 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,59 +11,41 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
- uses: actions/checkout@v4 | ||
- uses: prewk/s3-cp-action@v2 | ||
with: | ||
root-reserve-mb: 30000 | ||
swap-size-mb: 1024 | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
- uses: actions/checkout@v2 | ||
- uses: prewk/[email protected] | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
SOURCE: 's3://ctds-stata/Stata17Linux64.tar.gz' | ||
DEST: './jupyter-pystata-gen3-licensed/resources/' | ||
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
source: 's3://ctds-stata/StataNow18Linux64.tar.gz' | ||
dest: './jupyter-pystata-gen3-licensed/resources/' | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=$(echo $(echo ${GITHUB_REF#refs/*/} | tr / _))" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Determine image to build | ||
id: parse_image | ||
shell: python | ||
run: | | ||
import os | ||
build_target = "jupyter-pystata-licensed" | ||
print(f"Will trigger build for: {build_target}") | ||
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: | ||
print(f'build_target={build_target}', file=fh) | ||
echo "IMAGE_TAG=$(echo ${GITHUB_REF#refs/*/} | tr / _)" | ||
echo "IMAGE_TAG=$(echo ${GITHUB_REF#refs/*/} | tr / _)" >> $GITHUB_ENV | ||
- if: ${{ steps.parse_image.outputs.build_target }} | ||
name: Sanitize image name | ||
id: sanitize_name | ||
run: | | ||
IMAGE_NAME=$( sed 's/[^[:alnum:]]/_/g' <<< ${{ steps.parse_image.outputs.build_target }} ); | ||
echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT | ||
- name: Login to Quay.io | ||
id: login | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | ||
|
||
- name: Build Image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
- name: Extract metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
image: jupyter-pystata-gen3-licensed | ||
tags: ${{ steps.extract_branch.outputs.branch }} | ||
dockerfiles: ./jupyter-pystata-gen3-licensed/Dockerfile | ||
images: | | ||
quay.io/cdis/jupyter-pystata-gen3-licensed:${{ env.IMAGE_TAG }} | ||
- name: Push To quay.io | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
- name: Build and Push Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: quay.io/cdis | ||
username: ${{ secrets.QUAY_SERVICE_ACCOUNT_USER }} | ||
password: ${{ secrets.QUAY_SERVICE_ACCOUNT_PASSWORD }} | ||
context: ./jupyter-pystata-gen3-licensed | ||
file: "./jupyter-pystata-gen3-licensed/Dockerfile" | ||
push: true | ||
tags: | | ||
quay.io/cdis/jupyter-pystata-gen3-licensed:${{ env.IMAGE_TAG }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -11,41 +11,41 @@ jobs: | |
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Maximize build space | ||
uses: easimon/maximize-build-space@master | ||
- uses: actions/checkout@v4 | ||
- uses: prewk/s3-cp-action@v2 | ||
with: | ||
root-reserve-mb: 30000 | ||
swap-size-mb: 1024 | ||
remove-dotnet: 'true' | ||
remove-android: 'true' | ||
remove-haskell: 'true' | ||
- uses: actions/checkout@v2 | ||
- uses: prewk/[email protected] | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
SOURCE: 's3://ctds-stata/Stata17Linux64.tar.gz' | ||
DEST: './jupyter-pystata-user-licensed/resources/' | ||
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
source: 's3://ctds-stata/StataNow18Linux64.tar.gz' | ||
dest: './jupyter-pystata-user-licensed/resources/' | ||
|
||
- name: Extract branch name | ||
shell: bash | ||
run: echo "::set-output name=branch::$(echo $(echo ${GITHUB_REF#refs/*/} | tr / _))" | ||
id: extract_branch | ||
run: | | ||
echo "IMAGE_TAG=$(echo ${GITHUB_REF#refs/*/} | tr / _)" | ||
echo "IMAGE_TAG=$(echo ${GITHUB_REF#refs/*/} | tr / _)" >> $GITHUB_ENV | ||
- name: Build Image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
- name: Login to Quay.io | ||
id: login | ||
uses: docker/login-action@v3 | ||
with: | ||
image: jupyter-pystata-user-licensed | ||
tags: ${{ steps.extract_branch.outputs.branch }} | ||
dockerfiles: ./jupyter-pystata-user-licensed/Dockerfile | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_ROBOT_TOKEN }} | ||
|
||
- name: Push To quay.io | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
- name: Extract metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: quay.io/cdis | ||
username: ${{ secrets.QUAY_SERVICE_ACCOUNT_USER }} | ||
password: ${{ secrets.QUAY_SERVICE_ACCOUNT_PASSWORD }} | ||
images: | | ||
quay.io/cdis/jupyter-pystata-user-licensed:${{ env.IMAGE_TAG }} | ||
- name: Build and Push Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./jupyter-pystata-user-licensed | ||
file: "./jupyter-pystata-user-licensed/Dockerfile" | ||
push: true | ||
tags: | | ||
quay.io/cdis/jupyter-pystata-user-licensed:${{ env.IMAGE_TAG }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
.vscode/* | ||
.DS_store |
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
repos: | ||
- repo: [email protected]:Yelp/detect-secrets | ||
rev: v1.4.0 | ||
rev: v1.5.0 | ||
hooks: | ||
- id: detect-secrets | ||
args: ['--baseline', '.secrets.baseline'] | ||
exclude: .lock | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"plugins_used": [ | ||
{ | ||
"name": "ArtifactoryDetector" | ||
|
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
Stata17Linux64.tar.gz | ||
StataNow18Linux64.tar.gz | ||
stata.lic |
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 |
---|---|---|
@@ -1,23 +1,25 @@ | ||
FROM quay.io/cdis/jupyter-pystata-user-licensed:1.2.1 | ||
FROM quay.io/cdis/jupyter-pystata-user-licensed:feat_stata-base-update | ||
|
||
USER root | ||
RUN apt-get update | ||
RUN apt-get install -y firefox | ||
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux64.tar.gz | ||
RUN wget https://github.com/mozilla/geckodriver/releases/download/v0.35.0/geckodriver-v0.35.0-linux64.tar.gz | ||
RUN tar -xvzf geckodriver* | ||
RUN mv geckodriver /bin/ | ||
|
||
COPY jupyter-pystata-gen3-licensed/resources/wait_for_license.sh /tmp/ | ||
COPY jupyter-pystata-gen3-licensed/resources/setup_licensed_notebook.py /tmp/ | ||
COPY ./resources/wait_for_license.sh /tmp/ | ||
COPY ./resources/setup_licensed_notebook.py /tmp/ | ||
RUN chmod 777 /tmp/wait_for_license.sh /tmp/setup_licensed_notebook.py | ||
|
||
COPY ./resources/licensed_stata_session.ipynb $HOME | ||
RUN chown $NB_USER $HOME/licensed_stata_session.ipynb | ||
|
||
USER $NB_USER | ||
RUN pip3 install selenium | ||
|
||
# Pin stata_setup to avoid error on splash parameter | ||
RUN pip3 uninstall --yes stata-setup | ||
RUN pip3 install stata-setup==0.1.2 | ||
RUN pip3 install stata-setup | ||
|
||
|
||
# Remove the notebook created in jupyter-pystata-user-licensed | ||
RUN rm $HOME/Stata.ipynb | ||
COPY jupyter-pystata-gen3-licensed/resources/licensed_stata_session.ipynb $HOME |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
Stata17Linux64.tar.gz | ||
StataNow18Linux64.tar.gz | ||
stata.lic |
Oops, something went wrong.