Skip to content

Commit

Permalink
Release/22.06.0a1 (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha authored Jun 22, 2022
2 parents 50e6ec9 + 8feadfb commit 39aeb65
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 109 deletions.
110 changes: 51 additions & 59 deletions .github/workflows/build_and_test_on_pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
# Test the Docker image on every pull request.
#
#
# The steps are:
# 1. Build docker image using cached data.
# 2. Start the docker container with local folder mounted to it.
Expand All @@ -9,66 +10,57 @@

name: build-and-test-image-from-pull-request

on:
[pull_request]
on: [pull_request]

jobs:

build-and-test:
build-and-test:

runs-on: ubuntu-latest
timeout-minutes: 45
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
-
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
-
name: Build image locally
uses: docker/build-push-action@v2
with:
load: true
push: false
tags: aiidalab-docker-stack:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
-
name: Start and test the container
id: test_run
run: |
mkdir tmp
export DOCKERID=`docker run -v $PWD/tmp:/home/aiida -d aiidalab-docker-stack:latest`
echo "::set-output name=docker_id_first_run::${DOCKERID}"
docker exec --tty --user root $DOCKERID wait-for-services
docker exec --tty --user aiida $DOCKERID wait-for-services
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c '/usr/lib/postgresql/10/bin/pg_ctl -D /home/$SYSTEM_USER/.postgresql status' # Check that postgres is up.
docker exec --tty --user root $DOCKERID /bin/bash -l -c 'service rabbitmq-server status' # Check that rabbitmq is up.
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'conda create -y -n test_env python=3.8' # Check that one can create a new conda environment.
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'conda activate test_env' # Check that new environment works.
sudo cp tmp/.ssh/id_rsa . # Copy id_rsa file from the mounted folder.
docker stop $DOCKERID # Stop the container.
export DOCKERID=`docker run -v $PWD/tmp:/home/aiida -d aiidalab-docker-stack:latest` # Start a new container using the same mounted folder.
echo "::set-output name=docker_id_second_run::${DOCKERID}"
docker exec --tty $DOCKERID wait-for-services
sudo diff id_rsa tmp/.ssh/id_rsa # Check that the id_rsa file wasn't modified.
-
name: Show the container log (first run).
if: always()
run: docker logs "${{ steps.test_run.outputs.docker_id_first_run }}"
-
name: Show the container log (second run).
if: always()
run: docker logs "${{ steps.test_run.outputs.docker_id_second_run }}"
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build image locally
uses: docker/build-push-action@v2
with:
load: true
push: false
tags: aiidalab-docker-stack:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Start and test the container
id: test_run
run: |
mkdir tmp
export DOCKERID=`docker run -v $PWD/tmp:/home/aiida -d aiidalab-docker-stack:latest`
echo "::set-output name=docker_id_first_run::${DOCKERID}"
docker exec --tty --user root $DOCKERID wait-for-services
docker exec --tty --user aiida $DOCKERID wait-for-services
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c '/usr/lib/postgresql/12/bin/pg_ctl -D /home/$SYSTEM_USER/.postgresql status' # Check that postgres is up.
docker exec --tty --user root $DOCKERID /bin/bash -l -c 'service rabbitmq-server status' # Check that rabbitmq is up.
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'conda create -y -n test_env python=3.8' # Check that one can create a new conda environment.
docker exec --tty --user aiida $DOCKERID /bin/bash -l -c 'conda activate test_env' # Check that new environment works.
sudo cp tmp/.ssh/id_rsa . # Copy id_rsa file from the mounted folder.
docker stop $DOCKERID # Stop the container.
export DOCKERID=`docker run -v $PWD/tmp:/home/aiida -d aiidalab-docker-stack:latest` # Start a new container using the same mounted folder.
echo "::set-output name=docker_id_second_run::${DOCKERID}"
docker exec --tty $DOCKERID wait-for-services
sudo diff id_rsa tmp/.ssh/id_rsa # Check that the id_rsa file wasn't modified.
- name: Show the container log (first run).
if: always()
run: docker logs "${{ steps.test_run.outputs.docker_id_first_run }}"
- name: Show the container log (second run).
if: always()
run: docker logs "${{ steps.test_run.outputs.docker_id_second_run }}"
75 changes: 35 additions & 40 deletions .github/workflows/release_image.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
---
# Build and push image to DockerHub

name: release-image

on:
push:
branches:
- master
- develop
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"
push:
branches:
- master
- develop
tags:
- v[0-9]+.[0-9]+.[0-9]+*

jobs:

build-docker-image:
build-docker-image:

runs-on: ubuntu-latest
timeout-minutes: 45
runs-on: ubuntu-latest
timeout-minutes: 45

steps:
-
uses: actions/checkout@v2
-
name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
tags: |
type=ref,event=branch
type=match,pattern=v(.*),group=1
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
steps:
- uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}
tags: |
type=ref,event=branch
type=match,pattern=v(.*),group=1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.1
hooks:
- id: yamlfmt

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.16.0
hooks:
- id: check-github-workflows
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM aiidateam/aiida-core:1.6.5-bionic
FROM aiidateam/aiida-core:1.6.8

LABEL maintainer="AiiDAlab Team <[email protected]>"

Expand Down Expand Up @@ -58,7 +58,7 @@ RUN /usr/bin/pip3 install --upgrade pip
# Jupyter dependencies installed into system python environment
# which runs the jupyter notebook server.
COPY requirements-server.txt .
RUN /usr/local/bin/pip install -r /opt/requirements-server.txt \
RUN /usr/local/bin/pip install -r /opt/requirements-server.txt \
&& /usr/local/bin/pip cache purge

# Install and enable appmode.
Expand All @@ -75,7 +75,7 @@ RUN /usr/local/bin/jupyter serverextension enable --py --sys-prefix appmode
# npm install && \
# npm run build && \
# npm run build:webpack && \
# npm pack ./ && \
# npm pack ./ && \
# /usr/local/bin/jupyter labextension install *.tgz && \
# cd ..

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
---

The 'fix-permissions' script is licensed under the terms of the Modified BSD License
(also known as New or Revised or 3-Clause BSD), as follows:
Expand Down
2 changes: 0 additions & 2 deletions opt/start-notebook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,3 @@ else
--VoilaConfiguration.enable_nbextensions=True \
--NotebookApp.default_url="/apps/apps/home/start.ipynb"
fi


4 changes: 2 additions & 2 deletions requirements-server.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dependencies for notebook server and interaction with JupyterHub
jupyterhub==1.5.0
jupyterlab==3.0.17
notebook==6.4.1
notebook==6.4.12
# Detect notebooks written in MyST Markdown
jupytext==1.13.4
# Dependencies for jupyter widgets
Expand All @@ -11,7 +11,7 @@ ipywidgets-extended==1.0.5
nglview==2.7.7
widget-periodictable==2.1.5
# Used for exposing AiiDA REST API to the outside world
jupyter-server-proxy==3.1.0
jupyter-server-proxy==3.2.1
# Install voila package and AiiDAlab voila template.
voila==0.2.10
voila-aiidalab-template==0.2.1
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aiidalab==21.11.1
aiidalab-widgets-base==1.1.1
aiidalab==22.02.0
aiidalab-widgets-base==1.3.3
binaryornot~=0.4
bokeh~=2.0
bqplot~=0.12
Expand Down

0 comments on commit 39aeb65

Please sign in to comment.