-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
183 additions
and
21 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
name: Build environment | ||
description: Create build environment | ||
|
||
inputs: | ||
architecture: | ||
description: architecture to be run on | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
# actions/setup-python doesn't support Linux arm64 runners | ||
# See: https://github.com/actions/setup-python/issues/108 | ||
# python3 is manually preinstalled in the arm64 VM self-hosted runner | ||
- name: Set Up Python 🐍 | ||
if: ${{ inputs.architecture == 'amd64' }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install Dev Dependencies 📦 | ||
if: ${{ inputs.architecture == 'amd64' }} | ||
run: | | ||
pip install --upgrade pip | ||
pip install --upgrade -r docker/requirements-dev.txt | ||
shell: bash | ||
|
||
- name: Install Dev Dependencies 📦 | ||
if: ${{ inputs.architecture == 'arm64' }} | ||
run: | | ||
pip install --upgrade pip | ||
pip install --upgrade -r docker/requirements-dev-arm64.txt | ||
shell: bash |
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,42 @@ | ||
--- | ||
name: Downstream tests | ||
description: Integration downstream tests the bulid image | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- name: Set jupyter token env | ||
run: echo "JUPYTER_TOKEN=$(openssl rand -hex 32)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Run pytest to test image is working | ||
run: TAG=newly-baked pytest tests_integration/test_image.py | ||
shell: bash | ||
|
||
# The Firefox and its engine geckodrive need do be installed manually to run | ||
- name: Install Firefox | ||
uses: browser-actions/setup-firefox@latest | ||
with: | ||
firefox-version: '96.0' | ||
|
||
- name: Install geckodriver | ||
run: | | ||
wget -c https://github.com/mozilla/geckodriver/releases/download/v0.30.0/geckodriver-v0.30.0-linux64.tar.gz | ||
tar xf geckodriver-v0.30.0-linux64.tar.gz -C /usr/local/bin | ||
shell: bash | ||
|
||
- name: Run pytest for firefox | ||
run: TAG=newly-baked pytest --driver Firefox tests_integration/test_app.py | ||
shell: bash | ||
|
||
- name: Run pytest for Chrome | ||
run: TAG=newly-baked pytest --driver Chrome tests_integration/test_app.py | ||
shell: bash | ||
|
||
- name: Upload screenshots as artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Screenshots-CI | ||
path: screenshots/ | ||
if-no-files-found: error |
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,45 @@ | ||
--- | ||
# Run basic tests for this app on the latest aiidalab-docker image. | ||
name: smoke tests on notebooks | ||
|
||
on: [push, pull_request] | ||
|
||
|
||
# https://docs.github.com/en/actions/using-jobs/using-concurrency | ||
concurrency: | ||
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
build-test: | ||
|
||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
||
steps: | ||
- name: Checkout Repo ⚡️ | ||
uses: actions/checkout@v3 | ||
- name: Set Up Python 🐍 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install Dev Dependencies 📦 | ||
run: | | ||
pip install --upgrade pip | ||
pip install --upgrade -r docker/requirements-dev.txt | ||
- name: Build image 🛠 | ||
working-directory: docker | ||
run: docker buildx bake -f docker-bake.hcl --load | ||
env: | ||
# Use buildx | ||
DOCKER_BUILDKIT: 1 | ||
# Full logs for CI build | ||
BUILDKIT_PROGRESS: plain | ||
shell: bash | ||
|
||
- name: Run tests ✅ | ||
uses: ./.github/actions/integration-tests |
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 |
---|---|---|
|
@@ -109,3 +109,6 @@ venv.bak/ | |
|
||
.DS_Store | ||
.vscode | ||
|
||
# screenshots | ||
screenshots/ |
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,18 @@ | ||
# syntax=docker/dockerfile:1 | ||
FROM aiidalab/full-stack:latest | ||
|
||
# Copy whole repo and pre-install the dependencies and app to the tmp folder. | ||
# In the before notebook scripts the app will be re-installed by moving it to the app folder. | ||
ENV PREINSTALL_APP_FOLDER ${HOME}/aiidalab-widgets-base | ||
COPY --chown=${NB_UID}:${NB_GID} --from=src . ${PREINSTALL_APP_FOLDER} | ||
|
||
USER ${NB_USER} | ||
|
||
RUN cd ${PREINSTALL_APP_FOLDER} && \ | ||
# Remove all untracked files and directories. For example the setup lock flag file. | ||
git clean -fx && \ | ||
pip install . --no-cache-dir && \ | ||
fix-permissions "${CONDA_DIR}" && \ | ||
fix-permissions "/home/${NB_USER}" | ||
|
||
WORKDIR "/home/${NB_USER}" |
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,16 @@ | ||
# docker-bake.hcl for building QeApp images | ||
group "default" { | ||
targets = ["awb"] | ||
} | ||
|
||
variable "ORGANIZATION" { | ||
default = "aiidalab" | ||
} | ||
|
||
target "awb" { | ||
tags = ["${ORGANIZATION}/aiidalab-widgets-base:newly-baked"] | ||
context = "." | ||
contexts = { | ||
src = ".." | ||
} | ||
} |
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,11 @@ | ||
docker | ||
requests | ||
pre-commit | ||
pytest | ||
pytest-docker | ||
|
||
# test dependencies | ||
pytest-selenium | ||
pytest-html<4.0 | ||
selenium~=4.9.0 | ||
webdriver-manager |
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