diff --git a/.github/workflows/docker-publish.yaml b/.github/workflows/docker-publish.yaml index 958745f..3e2d3f5 100644 --- a/.github/workflows/docker-publish.yaml +++ b/.github/workflows/docker-publish.yaml @@ -1,13 +1,22 @@ name: Publish Docker Container -on: [push] +on: #[push] jobs: Build: name: Create and Push Docker Container runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: setup-docker - uses: docker-practice/actions-setup-docker@1.0.11 + - name: Set up QEMU + with: + platforms: arm64 + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + id: buildx + with: + install: true + uses: docker/setup-buildx-action@v2 + - name: Available platforms + run: echo ${{ steps.buildx.outputs.platforms }} - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: @@ -16,5 +25,5 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and Publish Docker Image run: | - docker build -t ghcr.io/fairdatapipeline/rsecon:latest . - docker push ghcr.io/fairdatapipeline/rsecon:latest + docker build -t ghcr.io/fairdatapipeline/rsecon:aarm64 . + docker push ghcr.io/fairdatapipeline/rsecon:aarm64 diff --git a/Dockerfile b/Dockerfile index 007aa6a..46f4fb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM jupyter/datascience-notebook:julia-1.7.3 +FROM jupyter/datascience-notebook:aarch64-julia-1.8.0 LABEL org.opencontainers.image.source="https://github.com/FAIRDataPipeline/RSECon22" USER root @@ -21,29 +21,31 @@ RUN apt update && \ libjsoncpp-dev \ curl \ libcurl4-openssl-dev \ - libyaml-cpp-dev + libyaml-cpp-dev \ + imagemagick # Java RUN wget https://services.gradle.org/distributions/gradle-7.5-bin.zip && \ - unzip gradle-*.zip -RUN cp -pr gradle-*/* /usr/local -RUN rm -r gradle-7.5 && \ + unzip gradle-*.zip && \ + cp -pr gradle-*/* /usr/local && \ + rm -r gradle-7.5 && \ rm gradle-7.5-bin.zip && \ mkdir temp # Python Dependencies WORKDIR ${USER_HOME}/temp RUN wget https://raw.githubusercontent.com/FAIRDataPipeline/FAIR-CLI/develop/pyproject.toml && \ - wget https://raw.githubusercontent.com/FAIRDataPipeline/data-registry/main/local-requirements.txt -RUN mamba install --quiet --yes 'poetry' && \ + mamba install --quiet --yes 'poetry' && \ mamba clean --all -f -y RUN poetry config virtualenvs.create false \ && poetry install --no-root --no-interaction --no-ansi + # Clone Repos and allow ambigous permissions WORKDIR ${USER_HOME} RUN git clone https://github.com/FAIRDataPipeline/cppSimpleModel.git && \ git clone https://github.com/FAIRDataPipeline/DataPipeline.jl.git && \ + git clone https://github.com/FAIRDataPipeline/javaDataPipeline.git && \ git clone https://github.com/FAIRDataPipeline/javaSimpleModel.git && \ git clone https://github.com/FAIRDataPipeline/rSimpleModel.git && \ git clone https://github.com/FAIRDataPipeline/rDataPipeline.git && \ @@ -51,42 +53,63 @@ RUN git clone https://github.com/FAIRDataPipeline/cppSimpleModel.git && \ git config --global --add safe.directory ${USER_HOME}/DataPipeline.jl && \ git config --global --add safe.directory ${USER_HOME}/javaSimpleModel && \ git config --global --add safe.directory ${USER_HOME}/rSimpleModel && \ - rm -r temp + git config --global --add safe.directory ${USER_HOME}/DataPipeline.jl # CPP Simple Model WORKDIR ${USER_HOME}/cppSimpleModel -RUN cmake -Bbuild -RUN cmake --build build -j4 +RUN cmake -Bbuild && \ + cmake --build build -j4 #Julia Simple Model WORKDIR "${USER_HOME}/DataPipeline.jl" -RUN julia -e 'using Pkg; Pkg.instantiate()' && \ - julia --project=examples/fdp -e 'using Pkg; Pkg.instantiate()' +RUN git checkout updated-deps && \ + julia -e 'using Pkg; Pkg.instantiate()' && \ + julia --project=examples/fdp -e 'using Pkg; Pkg.instantiate()' && \ + julia --project=examples/fdp -e 'using Pkg; Pkg.precompile()' + +# Java Data Pipeline +WORKDIR "${USER_HOME}/javaDataPipeline" +RUN git checkout ro-crate-fix && \ + gradle clean && \ + gradle build # Java Simple Model WORKDIR "${USER_HOME}/javaSimpleModel" -RUN gradle build +RUN git checkout local_deps && \ + gradle clean && \ + gradle build # R Simple Model -WORKDIR ${USER_HOME}/rSimpleModel +WORKDIR ${USER_HOME}/temp RUN conda config --add channels pcgr && \ + conda config --add channels anaconda && \ conda config --add channels bioconda && \ mamba install --quiet --yes \ + 'pkg-config' \ + 'libcurl' \ 'poppler' \ 'librsvg' \ 'glib' \ - 'bioconductor-rhdf5' \ - 'r-rsvg' \ - 'r-magick' \ - 'r-pdftools' \ + 'libgit2' \ && \ mamba clean --all -f -y -RUN R -e 'cat(withr::with_libpaths(new="/opt/conda/lib/R/library", devtools::install_local() ) )' +RUN wget https://imagemagick.org/archive/ImageMagick.tar.gz && \ + tar xvzf ImageMagick.tar.gz && \ + cd ImageMagick-* && \ + ./configure --prefix=/opt/conda && \ + make && \ + make install +WORKDIR ${USER_HOME}/rSimpleModel +RUN echo 'options(stringsAsFactors = FALSE)' >> /opt/conda/lib/R/etc/Rprofile.site && \ + R -e 'install.packages("magick", lib ="/opt/conda/lib/R/library", repos="https://cloud.r-project.org/", configure.vars="INCLUDE_DIR=/opt/conda/include/ImageMagick-7")' && \ + R -e 'cat(withr::with_libpaths(new="/opt/conda/lib/R/library", devtools::install_local("/home/jovyan/rDataPipeline") ) )' && \ + R -e 'cat(withr::with_libpaths(new="/opt/conda/lib/R/library", devtools::install_local() ) )' WORKDIR ${USER_HOME} COPY ./Notebooks . # Permissiona -RUN fix-permissions "${JULIA_PKGDIR}" && \ +RUN rm -r temp && \ + fix-permissions "${JULIA_PKGDIR}" && \ fix-permissions "${CONDA_DIR}" && \ fix-permissions "/home/${NB_USER}" diff --git a/Notebooks/1_registry_cli_install.ipynb b/Notebooks/1_registry_cli_install.ipynb index b5f6ee2..1c46721 100644 --- a/Notebooks/1_registry_cli_install.ipynb +++ b/Notebooks/1_registry_cli_install.ipynb @@ -17,21 +17,39 @@ "metadata": {}, "outputs": [], "source": [ - "!fair registry install" + "# Install the Local Registry using the ro_crate enabled version\n", + "!fair registry install --version origin/ro_crate" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Start the local registry binding to all addresses (0.0.0.0)\n", + "!fair registry start --address 0.0.0.0" ] } ], "metadata": { "kernelspec": { - "display_name": "Python 3.9.12 64-bit", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", "name": "python", - "version": "3.9.12" + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.6" }, - "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "b0fa6594d8f4cbf19f97940f81e996739fb7646882a419484c72d19e05852a7e" @@ -39,5 +57,5 @@ } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/Notebooks/2e_r.ipynb b/Notebooks/2e_r.ipynb index 2afe4d1..ad1542d 100644 --- a/Notebooks/2e_r.ipynb +++ b/Notebooks/2e_r.ipynb @@ -57,7 +57,7 @@ "mimetype": "text/x-r-source", "name": "R", "pygments_lexer": "r", - "version": "4.1.3" + "version": "3.6.3" } }, "nbformat": 4, diff --git a/README.md b/README.md index 7668baf..db0c93c 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,36 @@ -# RSECon22 Walktrhough: A FAIR Data Pipeline: provenance-driven data management for traceable scientific workflows +# RSECon22 Walkthrough: A FAIR Data Pipeline: provenance-driven data management for traceable scientific workflows -This repo contains the material for the RSECon22 walkthrough titled: A FAIR Data Pipeline: provenance-driven data management for traceable scientific workflows. The walkthrough uses a docker containter an Jupyter Labs (formally notebook) to run through an example usage of the FAIR DataPipeline. +This repo contains the material for the RSECon22 walkthrough titled: [*"A FAIR Data Pipeline: provenance-driven data management for traceable scientific workflows"*](https://virtual.oxfordabstracts.com/#/event/public/3101/submission/113). The walkthrough uses a docker container and Jupyter Labs (formally, a notebook) to run through an example usage of the [FAIR Data Pipeline](https://www.fairdatapipeline.org/). ## Prerequisites -The only prerequisite is an installation of Docker, Docker is available free from [docker.com](https://www.docker.com/). +The only prerequisite is an installation of Docker, which is available free from [docker.com](https://www.docker.com/). ## Running the Docker Container -The docker container is available on the GitHub Registry and can be pulled using the following command: +The docker container is available on the GitHub Package Registry and can be pulled using the following command(s): +### AMD64 ``` docker pull ghcr.io/fairdatapipeline/rsecon:latest ``` +### ARM64 +``` +docker pull ghcr.io/fairdatapipeline/rsecon:aarm64 +``` + The container can then be run using the following command: ``` -docker run -p 8000:8000 -p 8888:8888 +docker run -p 8000:8000 -p 8888:8888 ghcr.io/fairdatapipeline/rsecon:latest +``` + +OR + +``` +docker run -p 8000:8000 -p 8888:8888 ghcr.io/fairdatapipeline/rsecon:aarm64 ``` -Once the container has started, there will be an address to access the Jupyter Lab within the console, this address with include a token for authentication to the Jupyter Labs page. The link will take the form of: `http://127.0.0.1:8888/lab?token=`. + +Once the container has started, there will be an address to access the Jupyter Lab within the console. This address will include a token for authentication to the Jupyter Labs page. The link will take the form of: `http://127.0.0.1:8888/lab?token=`. This address can then be accessed through your web browser to give you access to the Jupyter Lab installation. @@ -34,7 +47,7 @@ The docker container contains 8 Jupyter Notebooks detailed below. This notebook contains codeblocks to install the FAIR Command Line Interface (CLI) and the FAIR Local Registry. ## Simple Models -The notebooks contain code blocks to run the SEIRS model example in different languages, they contain code to `register` inputs and `run` the models. +The notebooks contain code blocks to run the SEIRS model example in different languages: they contain code to `register` inputs and `run` the models. All the models use the same input and therefor the `pull` code block only needs to run from one of the files. @@ -60,11 +73,7 @@ The SEIRS models can be compared and graphed using the following notebook. Code block to `run` a comparison of the simple models producing a graph. ## Explore the registry -The local registry can be explored by running it and navigating to the web interface. +The local registry can be explored by running it and navigating to the web interface at: `127.0.0.1:8000` ### 4_start_registry Notebook to start and stop registry - - - -