From e0100f9cabe917cc88e2ec87480cc4316c69a1f8 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Wed, 26 Jan 2022 17:07:10 +1100 Subject: [PATCH 01/12] Add VNC to contributed templates --- desktop/.dockerignore | 4 + desktop/.gitignore | 338 +++++++++++++++++++++++++++++++++++++ desktop/.gitlab-ci.yml | 17 ++ desktop/.renku/renku.ini | 9 + desktop/.renkulfsignore | 22 +++ desktop/Dockerfile | 50 ++++++ desktop/README.md | 3 + desktop/data/.gitkeep | 0 desktop/environment.yml | 7 + desktop/notebooks/.gitkeep | 0 desktop/requirements.txt | 0 manifest.yaml | 5 + 12 files changed, 455 insertions(+) create mode 100644 desktop/.dockerignore create mode 100644 desktop/.gitignore create mode 100644 desktop/.gitlab-ci.yml create mode 100644 desktop/.renku/renku.ini create mode 100644 desktop/.renkulfsignore create mode 100644 desktop/Dockerfile create mode 100644 desktop/README.md create mode 100644 desktop/data/.gitkeep create mode 100644 desktop/environment.yml create mode 100644 desktop/notebooks/.gitkeep create mode 100644 desktop/requirements.txt diff --git a/desktop/.dockerignore b/desktop/.dockerignore new file mode 100644 index 0000000..ee0bcc5 --- /dev/null +++ b/desktop/.dockerignore @@ -0,0 +1,4 @@ +data +notebooks +.renku +.git \ No newline at end of file diff --git a/desktop/.gitignore b/desktop/.gitignore new file mode 100644 index 0000000..5c63f52 --- /dev/null +++ b/desktop/.gitignore @@ -0,0 +1,338 @@ + +# Created by https://www.gitignore.io/api/macos,python,R,linux,vim,emacs,visualstudiocode,intellij +# Edit at https://www.gitignore.io/?templates=macos,python,R,linux,vim,emacs,visualstudiocode,intellij + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# JetBrains templates +**___jb_tmp___ + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +# End of https://www.gitignore.io/api/macos,python,R,linux,vim,emacs,visualstudiocode,intellij + +# Renku +.renku.lock +.renku/tmp +.renku/cache \ No newline at end of file diff --git a/desktop/.gitlab-ci.yml b/desktop/.gitlab-ci.yml new file mode 100644 index 0000000..c3dc4ec --- /dev/null +++ b/desktop/.gitlab-ci.yml @@ -0,0 +1,17 @@ +variables: + GIT_STRATEGY: fetch + GIT_SSL_NO_VERIFY: "true" + GIT_LFS_SKIP_SMUDGE: 1 + +stages: + - build + +image_build: + stage: build + image: docker:stable + before_script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY + script: | + CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7) + docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 . + docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 \ No newline at end of file diff --git a/desktop/.renku/renku.ini b/desktop/.renku/renku.ini new file mode 100644 index 0000000..30559be --- /dev/null +++ b/desktop/.renku/renku.ini @@ -0,0 +1,9 @@ +[interactive] +default_url = /lab +cpu_request = 2 +mem_request = 8G + +[renku] +autocommit_lfs = false +lfs_threshold = 100kb + diff --git a/desktop/.renkulfsignore b/desktop/.renkulfsignore new file mode 100644 index 0000000..33acf17 --- /dev/null +++ b/desktop/.renkulfsignore @@ -0,0 +1,22 @@ +# WARNING: editing this file will impact the behavior of renku commands +# by telling renku to *not track* listed files with git LFS. +# +# By default, renku commands track all files above the renku configured lfs_threshold +# with git LFS to prevent accidentally checking in large files (default=100kb). +# You can update this threshold by calling 'renku config lfs_threshold kb'. +# +# Use this file to specify particular paths to *not track* with LFS regardless of +# their size. The syntax is the same as .gitignore (https://git-scm.com/docs/gitignore). +# Remember: files listed here, when generated during renku commands, will add to +# the size of your repo, and could slow things down. +# +# See https://github.com/SwissDataScienceCenter/renku-project-template for proper +# usage. + +# Warning: modifying the next line will check generated ipynb files (e.g. from papermill) into LFS: +# they will no longer be displayed in the renku UI +*.ipynb +*.py +*.r +*.md +*.rst \ No newline at end of file diff --git a/desktop/Dockerfile b/desktop/Dockerfile new file mode 100644 index 0000000..b90af9f --- /dev/null +++ b/desktop/Dockerfile @@ -0,0 +1,50 @@ +# For finding latest versions of the base image see +# https://github.com/SwissDataScienceCenter/renkulab-docker +ARG RENKU_BASE_IMAGE=renku/renkulab-vnc:0.10.3 +FROM ${RENKU_BASE_IMAGE} + +# Uncomment and adapt if code is to be included in the image +# COPY src /code/src + +# Uncomment and adapt if your R or python packages require extra linux (ubuntu) software +# e.g. the following installs apt-utils and vim; each pkg on its own line, all lines +# except for the last end with backslash '\' to continue the RUN line +# +# USER root +# RUN apt-get update && \ +# apt-get install -y --no-install-recommends \ +# apt-utils \ +# vim +# USER ${NB_USER} + +# install the python dependencies +COPY requirements.txt environment.yml /tmp/ +RUN conda env update -q -f /tmp/environment.yml && \ + /opt/conda/bin/pip install -r /tmp/requirements.txt && \ + conda clean -y --all && \ + conda env export -n "root" + +# RENKU_VERSION determines the version of the renku CLI +# that will be used in this image. To find the latest version, +# visit https://pypi.org/project/renku/#history. +ARG RENKU_VERSION={{ __renku_version__ | default("0.16.2") }} + +######################################################## +# Do not edit this section and do not add anything below + +# Install renku from pypi or from github if it's a dev version +RUN if [ -n "$RENKU_VERSION" ] ; then \ + source .renku/venv/bin/activate ; \ + currentversion=$(renku --version) ; \ + if [ "$RENKU_VERSION" != "$currentversion" ] ; then \ + pip uninstall renku ; \ + gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\3/p") ; \ + if [ -n "$gitversion" ] ; then \ + pip install --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\ + else \ + pip install --force renku==${RENKU_VERSION} ;\ + fi \ + fi \ + fi + +######################################################## diff --git a/desktop/README.md b/desktop/README.md new file mode 100644 index 0000000..0d5cd11 --- /dev/null +++ b/desktop/README.md @@ -0,0 +1,3 @@ +# RENKU desktop + +This project template showcases the latest VNC (virtual desktop) that RENKU comes with. diff --git a/desktop/data/.gitkeep b/desktop/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/desktop/environment.yml b/desktop/environment.yml new file mode 100644 index 0000000..a3ed1dd --- /dev/null +++ b/desktop/environment.yml @@ -0,0 +1,7 @@ +name: "base" +channels: + - defaults +# dependencies: +# - add packages here +# - one per line +prefix: "/opt/conda" \ No newline at end of file diff --git a/desktop/notebooks/.gitkeep b/desktop/notebooks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/desktop/requirements.txt b/desktop/requirements.txt new file mode 100644 index 0000000..e69de29 diff --git a/manifest.yaml b/manifest.yaml index e5ee169..22d47bf 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -9,3 +9,8 @@ description: Streamlit template based on a basic Python (3.7) project. variables: description: Describe your project +- folder: desktop + name: Renku Desktop + description: A Renku Desktop session with Python + variables: + description: Describe your project \ No newline at end of file From 94f688c9f25e83e7b46ca9f7ff8582ef379e2810 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Wed, 26 Jan 2022 17:10:17 +1100 Subject: [PATCH 02/12] Add QGIS template --- manifest.yaml | 7 +- qgis/.dockerignore | 4 + qgis/.gitignore | 338 ++++++++++++++++++++++++++++++++++++++++ qgis/.gitlab-ci.yml | 17 ++ qgis/.renku/renku.ini | 2 + qgis/.renkulfsignore | 22 +++ qgis/Dockerfile | 71 +++++++++ qgis/README.md | 5 + qgis/data/.gitkeep | 0 qgis/environment.yml | 8 + qgis/notebooks/.gitkeep | 0 qgis/qgis.desktop | 14 ++ qgis/requirements.txt | 1 + 13 files changed, 488 insertions(+), 1 deletion(-) create mode 100644 qgis/.dockerignore create mode 100644 qgis/.gitignore create mode 100644 qgis/.gitlab-ci.yml create mode 100644 qgis/.renku/renku.ini create mode 100644 qgis/.renkulfsignore create mode 100644 qgis/Dockerfile create mode 100644 qgis/README.md create mode 100644 qgis/data/.gitkeep create mode 100644 qgis/environment.yml create mode 100644 qgis/notebooks/.gitkeep create mode 100644 qgis/qgis.desktop create mode 100644 qgis/requirements.txt diff --git a/manifest.yaml b/manifest.yaml index 22d47bf..57e01ce 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -13,4 +13,9 @@ name: Renku Desktop description: A Renku Desktop session with Python variables: - description: Describe your project \ No newline at end of file + description: Describe your project +- folder: qgis + name: QGIS application + description: A popular, open-source geographic information system. + variables: + description: Describe your QGIS project \ No newline at end of file diff --git a/qgis/.dockerignore b/qgis/.dockerignore new file mode 100644 index 0000000..ee0bcc5 --- /dev/null +++ b/qgis/.dockerignore @@ -0,0 +1,4 @@ +data +notebooks +.renku +.git \ No newline at end of file diff --git a/qgis/.gitignore b/qgis/.gitignore new file mode 100644 index 0000000..5c63f52 --- /dev/null +++ b/qgis/.gitignore @@ -0,0 +1,338 @@ + +# Created by https://www.gitignore.io/api/macos,python,R,linux,vim,emacs,visualstudiocode,intellij +# Edit at https://www.gitignore.io/?templates=macos,python,R,linux,vim,emacs,visualstudiocode,intellij + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# JetBrains templates +**___jb_tmp___ + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +# End of https://www.gitignore.io/api/macos,python,R,linux,vim,emacs,visualstudiocode,intellij + +# Renku +.renku.lock +.renku/tmp +.renku/cache \ No newline at end of file diff --git a/qgis/.gitlab-ci.yml b/qgis/.gitlab-ci.yml new file mode 100644 index 0000000..c3dc4ec --- /dev/null +++ b/qgis/.gitlab-ci.yml @@ -0,0 +1,17 @@ +variables: + GIT_STRATEGY: fetch + GIT_SSL_NO_VERIFY: "true" + GIT_LFS_SKIP_SMUDGE: 1 + +stages: + - build + +image_build: + stage: build + image: docker:stable + before_script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY + script: | + CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7) + docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 . + docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 \ No newline at end of file diff --git a/qgis/.renku/renku.ini b/qgis/.renku/renku.ini new file mode 100644 index 0000000..34deb89 --- /dev/null +++ b/qgis/.renku/renku.ini @@ -0,0 +1,2 @@ +[renku "interactive"] +default_url = /vnc \ No newline at end of file diff --git a/qgis/.renkulfsignore b/qgis/.renkulfsignore new file mode 100644 index 0000000..33acf17 --- /dev/null +++ b/qgis/.renkulfsignore @@ -0,0 +1,22 @@ +# WARNING: editing this file will impact the behavior of renku commands +# by telling renku to *not track* listed files with git LFS. +# +# By default, renku commands track all files above the renku configured lfs_threshold +# with git LFS to prevent accidentally checking in large files (default=100kb). +# You can update this threshold by calling 'renku config lfs_threshold kb'. +# +# Use this file to specify particular paths to *not track* with LFS regardless of +# their size. The syntax is the same as .gitignore (https://git-scm.com/docs/gitignore). +# Remember: files listed here, when generated during renku commands, will add to +# the size of your repo, and could slow things down. +# +# See https://github.com/SwissDataScienceCenter/renku-project-template for proper +# usage. + +# Warning: modifying the next line will check generated ipynb files (e.g. from papermill) into LFS: +# they will no longer be displayed in the renku UI +*.ipynb +*.py +*.r +*.md +*.rst \ No newline at end of file diff --git a/qgis/Dockerfile b/qgis/Dockerfile new file mode 100644 index 0000000..6ff3e90 --- /dev/null +++ b/qgis/Dockerfile @@ -0,0 +1,71 @@ +# For finding latest versions of the base image see +# https://github.com/SwissDataScienceCenter/renkulab-docker +ARG RENKU_BASE_IMAGE=renku/renkulab-vnc:0.10.3 +FROM ${RENKU_BASE_IMAGE} + +USER root + +# Install qGIS +RUN apt-get update \ + && apt-get install -y -q --no-install-recommends \ + gnupg \ + software-properties-common \ + libqt5gui5 \ + && apt-get autoremove --purge \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* + +RUN wget -qO - https://qgis.org/downloads/qgis-2021.gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import \ + && chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg + +RUN add-apt-repository "deb https://qgis.org/ubuntu $(lsb_release -c -s) main" + +# Fixes a bug https://github.com/qgis/QGIS/issues/35649 and removes qgis-providers which may be a problem +# RUN apt-get remove --auto-remove libproj15 libproj-dev qgis-providers + +# Fixes downstream bug with libQt5Core.so.5 +RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 + +RUN apt-get update \ + && apt-get install -y -q --no-install-recommends \ + qgis + +# qgis-plugin-grass + +COPY --chown=root:root qgis.desktop /home/jovyan/Desktop/ +RUN chmod +x /home/jovyan/Desktop/qgis.desktop + +USER ${NB_USER} + +# install the python dependencies +COPY requirements.txt environment.yml /tmp/ +RUN conda env update -q -f /tmp/environment.yml && \ + /opt/conda/bin/pip install -r /tmp/requirements.txt && \ + conda clean -y --all && \ + conda env export -n "root" + +# RENKU_VERSION determines the version of the renku CLI +# that will be used in this image. To find the latest version, +# visit https://pypi.org/project/renku/#history. +ARG RENKU_VERSION=0.16.2 + +######################################################## +# Do not edit this section and do not add anything below + +# Install renku from pypi or from github if it's a dev version +RUN if [ -n "$RENKU_VERSION" ] ; then \ + source .renku/venv/bin/activate ; \ + currentversion=$(renku --version) ; \ + if [ "$RENKU_VERSION" != "$currentversion" ] ; then \ + pip uninstall renku -y ; \ + gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\3/p") ; \ + if [ -n "$gitversion" ] ; then \ + pip install --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\ + else \ + pip install --force renku==${RENKU_VERSION} ;\ + fi \ + fi \ + fi + +######################################################## diff --git a/qgis/README.md b/qgis/README.md new file mode 100644 index 0000000..91b0f0b --- /dev/null +++ b/qgis/README.md @@ -0,0 +1,5 @@ +# QGIS Template + +## How to use this template + +This is a Renku project with QGIS pre-installed! You can access it through the `/vnc` end-point of your Renku session. You may be familiar with the `/lab` end-point, but you can simply access the vnc by changing the URL. Open up QGIS and away you go! diff --git a/qgis/data/.gitkeep b/qgis/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/qgis/environment.yml b/qgis/environment.yml new file mode 100644 index 0000000..e8f5210 --- /dev/null +++ b/qgis/environment.yml @@ -0,0 +1,8 @@ +name: "base" +channels: + - defaults + - conda-forge +dependencies: + - qgis +# - one per line +prefix: "/opt/conda" \ No newline at end of file diff --git a/qgis/notebooks/.gitkeep b/qgis/notebooks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/qgis/qgis.desktop b/qgis/qgis.desktop new file mode 100644 index 0000000..5d3aa70 --- /dev/null +++ b/qgis/qgis.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Version=3.18 +Name=QGIS +GenericName=QGIS +X-GNOME-FullName=QGIS +Comment=Geographic Information System Application +Type=Application +Categories=Geography;Science;Geospatial; +Exec=/opt/conda/bin/qgis +TryExec=/opt/conda/bin/qgis +Terminal=false +StartupNotify=true +Icon=/usr/share/qgis/images/icons/qgis-icon-60x60.png +StartupWMClass=QGIS-main diff --git a/qgis/requirements.txt b/qgis/requirements.txt new file mode 100644 index 0000000..2d07ca0 --- /dev/null +++ b/qgis/requirements.txt @@ -0,0 +1 @@ +PyQt5 From 90286c78c553f2da806d9173830ce69f648ac184 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 27 Jan 2022 15:27:30 +1100 Subject: [PATCH 03/12] add matlab template --- manifest.yaml | 7 +- matlab/.dockerignore | 4 + matlab/.gitignore | 338 ++++++++++++++++++++++++++++++++++++++ matlab/.gitlab-ci.yml | 17 ++ matlab/.renku/renku.ini | 10 ++ matlab/.renkulfsignore | 22 +++ matlab/Dockerfile | 153 +++++++++++++++++ matlab/README.md | 9 + matlab/data/.gitkeep | 0 matlab/environment.yml | 7 + matlab/notebooks/.gitkeep | 0 matlab/requirements.txt | 2 + 12 files changed, 568 insertions(+), 1 deletion(-) create mode 100644 matlab/.dockerignore create mode 100644 matlab/.gitignore create mode 100644 matlab/.gitlab-ci.yml create mode 100644 matlab/.renku/renku.ini create mode 100644 matlab/.renkulfsignore create mode 100644 matlab/Dockerfile create mode 100644 matlab/README.md create mode 100644 matlab/data/.gitkeep create mode 100644 matlab/environment.yml create mode 100644 matlab/notebooks/.gitkeep create mode 100644 matlab/requirements.txt diff --git a/manifest.yaml b/manifest.yaml index 57e01ce..673b363 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -18,4 +18,9 @@ name: QGIS application description: A popular, open-source geographic information system. variables: - description: Describe your QGIS project \ No newline at end of file + description: Describe your QGIS project +- folder: matlab + name: MATLAB + description: A MATLAB client through Jupyter proxy + variables: + description: Describe your MATLAB project \ No newline at end of file diff --git a/matlab/.dockerignore b/matlab/.dockerignore new file mode 100644 index 0000000..ee0bcc5 --- /dev/null +++ b/matlab/.dockerignore @@ -0,0 +1,4 @@ +data +notebooks +.renku +.git \ No newline at end of file diff --git a/matlab/.gitignore b/matlab/.gitignore new file mode 100644 index 0000000..5c63f52 --- /dev/null +++ b/matlab/.gitignore @@ -0,0 +1,338 @@ + +# Created by https://www.gitignore.io/api/macos,python,R,linux,vim,emacs,visualstudiocode,intellij +# Edit at https://www.gitignore.io/?templates=macos,python,R,linux,vim,emacs,visualstudiocode,intellij + +### Emacs ### +# -*- mode: gitignore; -*- +*~ +\#*\# +/.emacs.desktop +/.emacs.desktop.lock +*.elc +auto-save-list +tramp +.\#* + +# Org-mode +.org-id-locations +*_archive + +# flymake-mode +*_flymake.* + +# eshell files +/eshell/history +/eshell/lastdir + +# elpa packages +/elpa/ + +# reftex files +*.rel + +# AUCTeX auto folder +/auto/ + +# cask packages +.cask/ +dist/ + +# Flycheck +flycheck_*.el + +# server auth directory +/server/ + +# projectiles files +.projectile + +# directory configuration +.dir-locals.el + +# network security +/network-security.data + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/modules.xml +# .idea/*.iml +# .idea/modules + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +# JetBrains templates +**___jb_tmp___ + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history + +# End of https://www.gitignore.io/api/macos,python,R,linux,vim,emacs,visualstudiocode,intellij + +# Renku +.renku.lock +.renku/tmp +.renku/cache \ No newline at end of file diff --git a/matlab/.gitlab-ci.yml b/matlab/.gitlab-ci.yml new file mode 100644 index 0000000..c3dc4ec --- /dev/null +++ b/matlab/.gitlab-ci.yml @@ -0,0 +1,17 @@ +variables: + GIT_STRATEGY: fetch + GIT_SSL_NO_VERIFY: "true" + GIT_LFS_SKIP_SMUDGE: 1 + +stages: + - build + +image_build: + stage: build + image: docker:stable + before_script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY + script: | + CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7) + docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 . + docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 \ No newline at end of file diff --git a/matlab/.renku/renku.ini b/matlab/.renku/renku.ini new file mode 100644 index 0000000..f621434 --- /dev/null +++ b/matlab/.renku/renku.ini @@ -0,0 +1,10 @@ +[interactive] +default_url = /lab +cpu_request = 2 +mem_request = 8G +disk_request = 4G + +[renku] +autocommit_lfs = false +lfs_threshold = 100kb + diff --git a/matlab/.renkulfsignore b/matlab/.renkulfsignore new file mode 100644 index 0000000..33acf17 --- /dev/null +++ b/matlab/.renkulfsignore @@ -0,0 +1,22 @@ +# WARNING: editing this file will impact the behavior of renku commands +# by telling renku to *not track* listed files with git LFS. +# +# By default, renku commands track all files above the renku configured lfs_threshold +# with git LFS to prevent accidentally checking in large files (default=100kb). +# You can update this threshold by calling 'renku config lfs_threshold kb'. +# +# Use this file to specify particular paths to *not track* with LFS regardless of +# their size. The syntax is the same as .gitignore (https://git-scm.com/docs/gitignore). +# Remember: files listed here, when generated during renku commands, will add to +# the size of your repo, and could slow things down. +# +# See https://github.com/SwissDataScienceCenter/renku-project-template for proper +# usage. + +# Warning: modifying the next line will check generated ipynb files (e.g. from papermill) into LFS: +# they will no longer be displayed in the renku UI +*.ipynb +*.py +*.r +*.md +*.rst \ No newline at end of file diff --git a/matlab/Dockerfile b/matlab/Dockerfile new file mode 100644 index 0000000..af71f65 --- /dev/null +++ b/matlab/Dockerfile @@ -0,0 +1,153 @@ +# Copyright 2020 The MathWorks, Inc. + +# Argument shared across multi-stage build to hold location of installed MATLAB +ARG BASE_ML_INSTALL_LOC=/tmp/matlab-install-location + +# For finding latest versions of the base image see +# https://github.com/SwissDataScienceCenter/renkulab-docker +ARG RENKU_BASE_IMAGE=renku/renkulab-py:3.9-0.10.3 + +# Replace "mathworks/matlab" with any Docker image that contains MATLAB +# MATLAB should be available on the path in the Docker image +FROM mathworks/matlab AS matlab-install-stage +ARG BASE_ML_INSTALL_LOC + +# Run code to locate a MATLAB install in the base image and softlink +# to BASE_ML_INSTALL_LOC for a latter stage to copy +RUN export ML_INSTALL_LOC=$(which matlab) \ + && if [ ! -z "$ML_INSTALL_LOC" ]; then \ + ML_INSTALL_LOC=$(dirname $(dirname $(readlink -f ${ML_INSTALL_LOC}))); \ + echo "soft linking: " $ML_INSTALL_LOC " to" ${BASE_ML_INSTALL_LOC}; \ + ln -s ${ML_INSTALL_LOC} ${BASE_ML_INSTALL_LOC}; \ + elif [ $BASE_ML_INSTALL_LOC = '/tmp/matlab-install-location' ]; then \ + echo "MATLAB was not found in your image."; exit 1; \ + else \ + echo "Proceeding with user provided path to MATLAB installation: ${BASE_ML_INSTALL_LOC}"; \ + fi + +FROM ${RENKU_BASE_IMAGE} +# Use Renku instead of the base notebook +# FROM jupyter/base-notebook +ARG BASE_ML_INSTALL_LOC + +# Switch to root user +USER root + +# Copy MATLAB install from supplied Docker image +COPY --from=matlab-install-stage ${BASE_ML_INSTALL_LOC} /usr/local/MATLAB + +# Put MATLAB on the PATH +RUN ln -s /usr/local/MATLAB/bin/matlab /usr/local/bin/matlab + +# Install MATLAB dependencies +# Reference: https://github.com/mathworks-ref-arch/container-images/tree/master/matlab-deps +# The following are the dependencies for R2021a +RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install --no-install-recommends -y \ + ca-certificates \ + libasound2 \ + libatk1.0-0 \ + libc6 \ + libcairo-gobject2 \ + libcairo2 \ + libcrypt1 \ + libcups2 \ + libdbus-1-3 \ + libfontconfig1 \ + libgdk-pixbuf2.0-0 \ + libgstreamer-plugins-base1.0-0 \ + libgstreamer1.0-0 \ + libgtk-3-0 \ + libnspr4 \ + libnss3 \ + libodbc1 \ + libpam0g \ + libpango-1.0-0 \ + libpangocairo-1.0-0 \ + libpangoft2-1.0-0 \ + libpython2.7 \ + libpython3.8 \ + libselinux1 \ + libsm6 \ + libsndfile1 \ + libuuid1 \ + libx11-6 \ + libx11-xcb1 \ + libxcb1 \ + libxcomposite1 \ + libxcursor1 \ + libxdamage1 \ + libxext6 \ + libxfixes3 \ + libxft2 \ + libxi6 \ + libxinerama1 \ + libxrandr2 \ + libxrender1 \ + libxt6 \ + libxtst6 \ + libxxf86vm1 \ + locales \ + locales-all \ + make \ + net-tools \ + procps \ + sudo \ + tzdata \ + unzip \ + zlib1g \ + && apt-get clean \ + && apt-get -y autoremove \ + && rm -rf /var/lib/apt/lists/* + +# Install jupyter-matlab-proxy dependencies +RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install --yes \ + xvfb \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Uncomment and adapt if code is to be included in the image +# COPY src /code/src + +# Uncomment and adapt if your R or python packages require extra linux (ubuntu) software +# e.g. the following installs apt-utils and vim; each pkg on its own line, all lines +# except for the last end with backslash '\' to continue the RUN line +# +# USER root +# RUN apt-get update && \ +# apt-get install -y --no-install-recommends \ +# apt-utils \ +# vim + +USER ${NB_USER} + +# install the python dependencies +COPY requirements.txt environment.yml /tmp/ +RUN conda env update -q -f /tmp/environment.yml && \ + /opt/conda/bin/pip install -r /tmp/requirements.txt && \ + conda clean -y --all && \ + conda env export -n "root" + +# RENKU_VERSION determines the version of the renku CLI +# that will be used in this image. To find the latest version, +# visit https://pypi.org/project/renku/#history. +ARG RENKU_VERSION={{ __renku_version__ | default("0.16.2") }} + +######################################################## +# Do not edit this section and do not add anything below + +# Install renku from pypi or from github if it's a dev version +RUN if [ -n "$RENKU_VERSION" ] ; then \ + source .renku/venv/bin/activate ; \ + currentversion=$(renku --version) ; \ + if [ "$RENKU_VERSION" != "$currentversion" ] ; then \ + pip uninstall renku -y ; \ + gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(rc[[:digit:]]\+\)*\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\4/p") ; \ + if [ -n "$gitversion" ] ; then \ + pip install --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\ + else \ + pip install --force renku==${RENKU_VERSION} ;\ + fi \ + fi \ + fi + +######################################################## diff --git a/matlab/README.md b/matlab/README.md new file mode 100644 index 0000000..a6e656d --- /dev/null +++ b/matlab/README.md @@ -0,0 +1,9 @@ +# {{ name }} + +{% if __project_description__ %} +{{ __project_description__ }} +{% endif %} + +## Your MATLAB enabled Renku project + +This project template allows you to use a fully fledged MATLAB client on Renku. diff --git a/matlab/data/.gitkeep b/matlab/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/matlab/environment.yml b/matlab/environment.yml new file mode 100644 index 0000000..a3ed1dd --- /dev/null +++ b/matlab/environment.yml @@ -0,0 +1,7 @@ +name: "base" +channels: + - defaults +# dependencies: +# - add packages here +# - one per line +prefix: "/opt/conda" \ No newline at end of file diff --git a/matlab/notebooks/.gitkeep b/matlab/notebooks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/matlab/requirements.txt b/matlab/requirements.txt new file mode 100644 index 0000000..5989e1f --- /dev/null +++ b/matlab/requirements.txt @@ -0,0 +1,2 @@ +jupyter-matlab-proxy +numpy From 481e6939469b57dc6cdf3fa5abf05cc92cfc3b85 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Tue, 1 Feb 2022 17:48:19 +1100 Subject: [PATCH 04/12] update desktop template based on comments --- desktop/.gitignore | 2 +- desktop/.renku/renku.ini | 11 ++--------- desktop/README.md | 40 ++++++++++++++++++++++++++++++++++++++-- 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/desktop/.gitignore b/desktop/.gitignore index 5c63f52..41af29c 100644 --- a/desktop/.gitignore +++ b/desktop/.gitignore @@ -335,4 +335,4 @@ tags # Renku .renku.lock .renku/tmp -.renku/cache \ No newline at end of file +.renku/cache diff --git a/desktop/.renku/renku.ini b/desktop/.renku/renku.ini index 30559be..34deb89 100644 --- a/desktop/.renku/renku.ini +++ b/desktop/.renku/renku.ini @@ -1,9 +1,2 @@ -[interactive] -default_url = /lab -cpu_request = 2 -mem_request = 8G - -[renku] -autocommit_lfs = false -lfs_threshold = 100kb - +[renku "interactive"] +default_url = /vnc \ No newline at end of file diff --git a/desktop/README.md b/desktop/README.md index 0d5cd11..99f02be 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -1,3 +1,39 @@ -# RENKU desktop +# {{ name }} +{% if __project_description__ %} +{{ __project_description__ }} +{% endif %} +## Introduction -This project template showcases the latest VNC (virtual desktop) that RENKU comes with. +This is a Renku project powered by a virtual desktop. By default, it is built on top of the latest Renku-compatible Python project. You'll find we have already created some +useful things like `data` and `notebooks` directories and +a `Dockerfile`. + +## Working with the project + +The simplest way to start your project is right from the Renku +platform - just click on the `Sessions` tab and start a new session. +This will start an interactive session right in your browser. + +To work with the project anywhere outside the Renku platform, +click the `Settings` tab where you will find the +git repo URLs - use `git` to clone the project on whichever machine you want. + +### Changing interactive session dependencies + +Initially we install a very minimal set of packages to keep the images small. +However, you can add python and conda packages in `requirements.txt` and +`environment.yml` to your heart's content. If you need more fine-grained +control over your environment, please see [the documentation](https://renku.readthedocs.io/en/latest/reference/templates.html). + +## Project configuration + +Project options can be found in `.renku/renku.ini`. In this +project there is currently only one option, which specifies +the default type of environment to open, in this case `/vnc` for +the virtual desktop. You may open the session in a new tab and change the ending to `/lab` if you wish to also use the JupyterLab interface. +interface. + +## Moving forward + +Once you feel at home with your project, we recommend that you replace +this README file with your own project documentation! Happy data wrangling! From 6cd3b49e254522783cea6b4d47ae860008f6772d Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Tue, 1 Feb 2022 17:49:42 +1100 Subject: [PATCH 05/12] Update renku.ini --- desktop/.renku/renku.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/.renku/renku.ini b/desktop/.renku/renku.ini index 34deb89..7df6283 100644 --- a/desktop/.renku/renku.ini +++ b/desktop/.renku/renku.ini @@ -1,2 +1,2 @@ -[renku "interactive"] -default_url = /vnc \ No newline at end of file +[interactive] +default_url = /vnc From 7c7efcf27e252ddf0d3c6e0e647f89e5a11a35e0 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Wed, 9 Feb 2022 12:31:44 +1100 Subject: [PATCH 06/12] change base images to v0.11.0 --- matlab/.renku/renku.ini | 13 ++--- matlab/Dockerfile | 107 +--------------------------------------- matlab/README.md | 40 +++++++++++++-- qgis/.renku/renku.ini | 2 +- qgis/Dockerfile | 51 ++++++------------- qgis/README.md | 42 ++++++++++++++-- qgis/environment.yml | 5 +- qgis/qgis.desktop | 14 ------ qgis/requirements.txt | 1 - 9 files changed, 100 insertions(+), 175 deletions(-) delete mode 100644 qgis/qgis.desktop diff --git a/matlab/.renku/renku.ini b/matlab/.renku/renku.ini index f621434..01978f2 100644 --- a/matlab/.renku/renku.ini +++ b/matlab/.renku/renku.ini @@ -1,10 +1,5 @@ [interactive] -default_url = /lab -cpu_request = 2 -mem_request = 8G -disk_request = 4G - -[renku] -autocommit_lfs = false -lfs_threshold = 100kb - +default_url = /vnc +cpu_request = 1 +mem_request = 4G +disk_request = 2G diff --git a/matlab/Dockerfile b/matlab/Dockerfile index af71f65..b9f2e7f 100644 --- a/matlab/Dockerfile +++ b/matlab/Dockerfile @@ -1,109 +1,7 @@ -# Copyright 2020 The MathWorks, Inc. - -# Argument shared across multi-stage build to hold location of installed MATLAB -ARG BASE_ML_INSTALL_LOC=/tmp/matlab-install-location - # For finding latest versions of the base image see # https://github.com/SwissDataScienceCenter/renkulab-docker -ARG RENKU_BASE_IMAGE=renku/renkulab-py:3.9-0.10.3 - -# Replace "mathworks/matlab" with any Docker image that contains MATLAB -# MATLAB should be available on the path in the Docker image -FROM mathworks/matlab AS matlab-install-stage -ARG BASE_ML_INSTALL_LOC - -# Run code to locate a MATLAB install in the base image and softlink -# to BASE_ML_INSTALL_LOC for a latter stage to copy -RUN export ML_INSTALL_LOC=$(which matlab) \ - && if [ ! -z "$ML_INSTALL_LOC" ]; then \ - ML_INSTALL_LOC=$(dirname $(dirname $(readlink -f ${ML_INSTALL_LOC}))); \ - echo "soft linking: " $ML_INSTALL_LOC " to" ${BASE_ML_INSTALL_LOC}; \ - ln -s ${ML_INSTALL_LOC} ${BASE_ML_INSTALL_LOC}; \ - elif [ $BASE_ML_INSTALL_LOC = '/tmp/matlab-install-location' ]; then \ - echo "MATLAB was not found in your image."; exit 1; \ - else \ - echo "Proceeding with user provided path to MATLAB installation: ${BASE_ML_INSTALL_LOC}"; \ - fi - +ARG RENKU_BASE_IMAGE=renku/renkulab-matlab:0.11.0 FROM ${RENKU_BASE_IMAGE} -# Use Renku instead of the base notebook -# FROM jupyter/base-notebook -ARG BASE_ML_INSTALL_LOC - -# Switch to root user -USER root - -# Copy MATLAB install from supplied Docker image -COPY --from=matlab-install-stage ${BASE_ML_INSTALL_LOC} /usr/local/MATLAB - -# Put MATLAB on the PATH -RUN ln -s /usr/local/MATLAB/bin/matlab /usr/local/bin/matlab - -# Install MATLAB dependencies -# Reference: https://github.com/mathworks-ref-arch/container-images/tree/master/matlab-deps -# The following are the dependencies for R2021a -RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install --no-install-recommends -y \ - ca-certificates \ - libasound2 \ - libatk1.0-0 \ - libc6 \ - libcairo-gobject2 \ - libcairo2 \ - libcrypt1 \ - libcups2 \ - libdbus-1-3 \ - libfontconfig1 \ - libgdk-pixbuf2.0-0 \ - libgstreamer-plugins-base1.0-0 \ - libgstreamer1.0-0 \ - libgtk-3-0 \ - libnspr4 \ - libnss3 \ - libodbc1 \ - libpam0g \ - libpango-1.0-0 \ - libpangocairo-1.0-0 \ - libpangoft2-1.0-0 \ - libpython2.7 \ - libpython3.8 \ - libselinux1 \ - libsm6 \ - libsndfile1 \ - libuuid1 \ - libx11-6 \ - libx11-xcb1 \ - libxcb1 \ - libxcomposite1 \ - libxcursor1 \ - libxdamage1 \ - libxext6 \ - libxfixes3 \ - libxft2 \ - libxi6 \ - libxinerama1 \ - libxrandr2 \ - libxrender1 \ - libxt6 \ - libxtst6 \ - libxxf86vm1 \ - locales \ - locales-all \ - make \ - net-tools \ - procps \ - sudo \ - tzdata \ - unzip \ - zlib1g \ - && apt-get clean \ - && apt-get -y autoremove \ - && rm -rf /var/lib/apt/lists/* - -# Install jupyter-matlab-proxy dependencies -RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install --yes \ - xvfb \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* # Uncomment and adapt if code is to be included in the image # COPY src /code/src @@ -117,8 +15,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install - # apt-get install -y --no-install-recommends \ # apt-utils \ # vim - -USER ${NB_USER} +# USER ${NB_USER} # install the python dependencies COPY requirements.txt environment.yml /tmp/ diff --git a/matlab/README.md b/matlab/README.md index a6e656d..a3ab173 100644 --- a/matlab/README.md +++ b/matlab/README.md @@ -1,9 +1,43 @@ # {{ name }} - {% if __project_description__ %} {{ __project_description__ }} {% endif %} +## Introduction + +This is a Renku project with MATLAB R2021b installed. You'll find we have already created some +useful things like `data` and `notebooks` directories and +a `Dockerfile`. + +## Working with the project + +When starting up the project you will be taken to the virtual desktop, +where the MATLAB Desktop icon should be visible. Double click that and you will be +asked to enter your license credentials. Once that is done, double click it again +and your MATLAB client will open. You may need to navigate to your project's directory, +which is usually `/home/jovyan/work/${Your Project Name}`. If you want to use JupyterLab alongside your desktop +view, click the "Open in new tab" button and then change the end-point from `/vnc` +to `/lab`. You can have both tabs with different end-points open at the same time. + +To work with the project anywhere outside the Renku platform, +click the `Settings` tab where you will find the +git repo URLs - use `git` to clone the project on whichever machine you want. + +### Changing interactive session dependencies + +Initially we install a very minimal set of packages to keep the images small. +However, you can add Python and conda packages in `requirements.txt` and +`environment.yml` to your heart's content. If you need more fine-grained +control over your environments, please see [the documentation](https://renku.readthedocs.io/en/latest/how-to-guides/session-customizing.html). + +## Project configuration + +Project options can be found in `.renku/renku.ini`. In this +project there is currently only one option, which specifies +the default type of end-point to open, in this case `/vnc` for +the virtual desktop. You can use the user interface on Renku +to change the defaults of computational resources too. -## Your MATLAB enabled Renku project +## Moving forward -This project template allows you to use a fully fledged MATLAB client on Renku. +Once you feel at home with your project, we recommend that you replace +this README file with your own project documentation! \ No newline at end of file diff --git a/qgis/.renku/renku.ini b/qgis/.renku/renku.ini index 34deb89..115df66 100644 --- a/qgis/.renku/renku.ini +++ b/qgis/.renku/renku.ini @@ -1,2 +1,2 @@ -[renku "interactive"] +[interactive] default_url = /vnc \ No newline at end of file diff --git a/qgis/Dockerfile b/qgis/Dockerfile index 6ff3e90..10a91ee 100644 --- a/qgis/Dockerfile +++ b/qgis/Dockerfile @@ -1,42 +1,21 @@ # For finding latest versions of the base image see # https://github.com/SwissDataScienceCenter/renkulab-docker -ARG RENKU_BASE_IMAGE=renku/renkulab-vnc:0.10.3 +ARG RENKU_BASE_IMAGE=renku/renkulab-qgis:0.11.0 FROM ${RENKU_BASE_IMAGE} -USER root +# Uncomment and adapt if code is to be included in the image +# COPY src /code/src -# Install qGIS -RUN apt-get update \ - && apt-get install -y -q --no-install-recommends \ - gnupg \ - software-properties-common \ - libqt5gui5 \ - && apt-get autoremove --purge \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /tmp/* - -RUN wget -qO - https://qgis.org/downloads/qgis-2021.gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import \ - && chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg - -RUN add-apt-repository "deb https://qgis.org/ubuntu $(lsb_release -c -s) main" - -# Fixes a bug https://github.com/qgis/QGIS/issues/35649 and removes qgis-providers which may be a problem -# RUN apt-get remove --auto-remove libproj15 libproj-dev qgis-providers - -# Fixes downstream bug with libQt5Core.so.5 -RUN strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 - -RUN apt-get update \ - && apt-get install -y -q --no-install-recommends \ - qgis - -# qgis-plugin-grass - -COPY --chown=root:root qgis.desktop /home/jovyan/Desktop/ -RUN chmod +x /home/jovyan/Desktop/qgis.desktop - -USER ${NB_USER} +# Uncomment and adapt if your R or python packages require extra linux (ubuntu) software +# e.g. the following installs apt-utils and vim; each pkg on its own line, all lines +# except for the last end with backslash '\' to continue the RUN line +# +# USER root +# RUN apt-get update && \ +# apt-get install -y --no-install-recommends \ +# apt-utils \ +# vim +# USER ${NB_USER} # install the python dependencies COPY requirements.txt environment.yml /tmp/ @@ -48,7 +27,7 @@ RUN conda env update -q -f /tmp/environment.yml && \ # RENKU_VERSION determines the version of the renku CLI # that will be used in this image. To find the latest version, # visit https://pypi.org/project/renku/#history. -ARG RENKU_VERSION=0.16.2 +ARG RENKU_VERSION={{ __renku_version__ | default("0.16.2") }} ######################################################## # Do not edit this section and do not add anything below @@ -59,7 +38,7 @@ RUN if [ -n "$RENKU_VERSION" ] ; then \ currentversion=$(renku --version) ; \ if [ "$RENKU_VERSION" != "$currentversion" ] ; then \ pip uninstall renku -y ; \ - gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\3/p") ; \ + gitversion=$(echo "$RENKU_VERSION" | sed -n "s/^[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\(rc[[:digit:]]\+\)*\(\.dev[[:digit:]]\+\)*\(+g\([a-f0-9]\+\)\)*\(+dirty\)*$/\4/p") ; \ if [ -n "$gitversion" ] ; then \ pip install --force "git+https://github.com/SwissDataScienceCenter/renku-python.git@$gitversion" ;\ else \ diff --git a/qgis/README.md b/qgis/README.md index 91b0f0b..d9b958d 100644 --- a/qgis/README.md +++ b/qgis/README.md @@ -1,5 +1,41 @@ -# QGIS Template +# {{ name }} +{% if __project_description__ %} +{{ __project_description__ }} +{% endif %} +## Introduction -## How to use this template +This is a Renku project with QGIS 3.18 installed. You'll find we have already created some +useful things like `data` and `notebooks` directories and +a `Dockerfile`. -This is a Renku project with QGIS pre-installed! You can access it through the `/vnc` end-point of your Renku session. You may be familiar with the `/lab` end-point, but you can simply access the vnc by changing the URL. Open up QGIS and away you go! +## Working with the project + +When starting up the project you will be taken to the virtual desktop, +where the QGIS Desktop icon should be visible. Double click that and you can get +started with QGIS right away. If you want to use JupyterLab alongside your desktop +view, click the "Open in new tab" button and then change the end-point from `/vnc` +to `/lab`. You can have both tabs with different end-points open at the same time. + +To work with the project anywhere outside the Renku platform, +click the `Settings` tab where you will find the +git repo URLs - use `git` to clone the project on whichever machine you want. + +### Changing interactive session dependencies + +Initially we install a very minimal set of packages to keep the images small. +However, you can add Python and conda packages in `requirements.txt` and +`environment.yml` to your heart's content. If you need more fine-grained +control over your environments, please see [the documentation](https://renku.readthedocs.io/en/latest/how-to-guides/session-customizing.html). + +## Project configuration + +Project options can be found in `.renku/renku.ini`. In this +project there is currently only one option, which specifies +the default type of end-point to open, in this case `/vnc` for +the virtual desktop. You can use the user interface on Renku +to change the defaults of computational resources too. + +## Moving forward + +Once you feel at home with your project, we recommend that you replace +this README file with your own project documentation! \ No newline at end of file diff --git a/qgis/environment.yml b/qgis/environment.yml index e8f5210..a3ed1dd 100644 --- a/qgis/environment.yml +++ b/qgis/environment.yml @@ -1,8 +1,7 @@ name: "base" channels: - defaults - - conda-forge -dependencies: - - qgis +# dependencies: +# - add packages here # - one per line prefix: "/opt/conda" \ No newline at end of file diff --git a/qgis/qgis.desktop b/qgis/qgis.desktop deleted file mode 100644 index 5d3aa70..0000000 --- a/qgis/qgis.desktop +++ /dev/null @@ -1,14 +0,0 @@ -[Desktop Entry] -Version=3.18 -Name=QGIS -GenericName=QGIS -X-GNOME-FullName=QGIS -Comment=Geographic Information System Application -Type=Application -Categories=Geography;Science;Geospatial; -Exec=/opt/conda/bin/qgis -TryExec=/opt/conda/bin/qgis -Terminal=false -StartupNotify=true -Icon=/usr/share/qgis/images/icons/qgis-icon-60x60.png -StartupWMClass=QGIS-main diff --git a/qgis/requirements.txt b/qgis/requirements.txt index 2d07ca0..e69de29 100644 --- a/qgis/requirements.txt +++ b/qgis/requirements.txt @@ -1 +0,0 @@ -PyQt5 From d7cfac4436613c5c53ec50bf769af253b7a91a34 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 10 Feb 2022 09:53:16 +1100 Subject: [PATCH 07/12] Update matlab/Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rok Roškar --- matlab/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/Dockerfile b/matlab/Dockerfile index b9f2e7f..ccc70d2 100644 --- a/matlab/Dockerfile +++ b/matlab/Dockerfile @@ -27,7 +27,7 @@ RUN conda env update -q -f /tmp/environment.yml && \ # RENKU_VERSION determines the version of the renku CLI # that will be used in this image. To find the latest version, # visit https://pypi.org/project/renku/#history. -ARG RENKU_VERSION={{ __renku_version__ | default("0.16.2") }} +ARG RENKU_VERSION={{ __renku_version__ | default("1.0.5") }} ######################################################## # Do not edit this section and do not add anything below From c720a3a0e7c2feaeac30834fd6f7302450796c85 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 10 Feb 2022 09:53:27 +1100 Subject: [PATCH 08/12] Update qgis/Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rok Roškar --- qgis/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qgis/Dockerfile b/qgis/Dockerfile index 10a91ee..9faa9ed 100644 --- a/qgis/Dockerfile +++ b/qgis/Dockerfile @@ -27,7 +27,7 @@ RUN conda env update -q -f /tmp/environment.yml && \ # RENKU_VERSION determines the version of the renku CLI # that will be used in this image. To find the latest version, # visit https://pypi.org/project/renku/#history. -ARG RENKU_VERSION={{ __renku_version__ | default("0.16.2") }} +ARG RENKU_VERSION={{ __renku_version__ | default("1.0.5") }} ######################################################## # Do not edit this section and do not add anything below From 2346ea0ecffcd95be5485e8a1cf2cff66cf3fb9c Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 10 Feb 2022 09:53:39 +1100 Subject: [PATCH 09/12] Update desktop/Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rok Roškar --- desktop/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/Dockerfile b/desktop/Dockerfile index b90af9f..7de8300 100644 --- a/desktop/Dockerfile +++ b/desktop/Dockerfile @@ -27,7 +27,7 @@ RUN conda env update -q -f /tmp/environment.yml && \ # RENKU_VERSION determines the version of the renku CLI # that will be used in this image. To find the latest version, # visit https://pypi.org/project/renku/#history. -ARG RENKU_VERSION={{ __renku_version__ | default("0.16.2") }} +ARG RENKU_VERSION={{ __renku_version__ | default("1.0.5") }} ######################################################## # Do not edit this section and do not add anything below From c8a904450c15c45f69e092e2d5bf9aac4c6056b5 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 10 Feb 2022 09:53:44 +1100 Subject: [PATCH 10/12] Update desktop/Dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Rok Roškar --- desktop/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/Dockerfile b/desktop/Dockerfile index 7de8300..c12fb01 100644 --- a/desktop/Dockerfile +++ b/desktop/Dockerfile @@ -1,6 +1,6 @@ # For finding latest versions of the base image see # https://github.com/SwissDataScienceCenter/renkulab-docker -ARG RENKU_BASE_IMAGE=renku/renkulab-vnc:0.10.3 +ARG RENKU_BASE_IMAGE=renku/renkulab-vnc:0.11.0 FROM ${RENKU_BASE_IMAGE} # Uncomment and adapt if code is to be included in the image From b243f7acb5d03e9e119082ad0413c995bf8b4c44 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 10 Feb 2022 09:54:41 +1100 Subject: [PATCH 11/12] Update .dockerignore --- desktop/.dockerignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/.dockerignore b/desktop/.dockerignore index ee0bcc5..c1021cc 100644 --- a/desktop/.dockerignore +++ b/desktop/.dockerignore @@ -1,4 +1,4 @@ data notebooks .renku -.git \ No newline at end of file +.git From 88d0460fd8bcf258274c5543ba545e21b99ab6f9 Mon Sep 17 00:00:00 2001 From: Gavin Lee Date: Thu, 10 Feb 2022 09:55:11 +1100 Subject: [PATCH 12/12] Update requirements.txt --- matlab/requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/matlab/requirements.txt b/matlab/requirements.txt index 5989e1f..8b13789 100644 --- a/matlab/requirements.txt +++ b/matlab/requirements.txt @@ -1,2 +1 @@ -jupyter-matlab-proxy -numpy +