r-workspace, ansible-terraform-workspace

This commit is contained in:
bluxmit 2022-07-19 16:49:46 +00:00
parent a2ca4cc657
commit 4a39a02670
75 changed files with 2602 additions and 233 deletions

View file

@ -1,5 +1,5 @@
ARG docker_registry=docker.io/alnoda
ARG image_tag=2.2
ARG image_tag=3.0
## Images used:
ARG BUILD_IMAGE=node:12.18.3
@ -65,6 +65,10 @@ COPY ./mkdocs/Ara.png /home/docs/docs/assets/home/
COPY ./mkdocs/Blast-radius.png /home/docs/docs/assets/home/
COPY ./mkdocs/Terraform-Rover.png /home/docs/docs/assets/home/
COPY ./mkdocs/helpers.py /home/docs/macros
COPY ./mkdocs/terraform-circle.svg /home/docs/docs/assets/
COPY ./mkdocs/terraform-circle-white.svg /home/docs/docs/assets/
COPY ./mkdocs/extra.css /home/docs/docs/stylesheets/
COPY ./mkdocs/about.md /home/docs/docs/about.md
RUN apt-get -y update \
&& apt-get install -y python-is-python3 \

View file

@ -1,11 +1,11 @@
<p align="center">
<img src="../../img/Alnoda-white.svg" alt="Alnoda logo" width="150">
<img src="./img/terraform-circle.svg" alt="Terraform logo" width="150">
</p>
# Ansible-Terraform Workspace
Dockerized development environment for Ansible and Terraform. Workspace will help to create and manage infrastructures;
visualize planned terraform changes; display ansible hosts plays; schedule and observe executions.
Containerized development, execution and admin environment for Ansible and Terraform.
Create, provision, visualize and manage infrastructures, schedule maintenance tasks.
<p align="center">
<img src="img/ansible-terraform-wid-collage.png" alt="Collage" width="750">
@ -47,29 +47,22 @@ and open [localhost:8020](http://localhost:8020) in browser.
**Dev tools:**
- [**Eclipse Theia**](https://theia-ide.org/docs/) - open source version of popular Visual Studio Code IDE. Theia is trully open-source, has
VS-Code extensions and works in browser. This means it can run inside a docker container on local machine or in cloud. A lot of beautiful color themes and many common plugins are already installed to save time.
VS-Code extensions and works in browser. This means it can run inside a docker container on local machine or in cloud. A lot of beautiful color themes and many common plugins are already installed to save time.
- [**Terminal**](https://github.com/tsl0922/ttyd) - secure browser-based terminal.
- [**FileBrowser**](https://github.com/filebrowser/filebrowser) - manage files and folders inside the workspace, and exchange data between local environment and the workspace
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
- [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) - create awesome documentation for your project with only markdown.
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
- Quicklaunch UI with getting started tutorial
Image is built from **Ubuntu 20.4** with the additional CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc, xplr
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Ubuntu 20.4** with the following CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Terminal multiplexer:** tmux
## Docs

View file

@ -0,0 +1,4 @@
Tool candidates:
- [Terraspace](https://github.com/boltops-tools/terraspace)
- [terraform-visual](https://github.com/hieven/terraform-visual)

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1144.438 1481.645 L 575.631 1792.779 L 575.631 2415.172 L 1144.438 2104.037 L 1144.438 1481.645 Z M 1775.773 443.626 L 1206.966 754.761 L 1206.966 1377.153 L 1775.773 1066.018 L 1775.773 443.626 Z M 1206.966 2067.81 L 1775.773 1756.306 L 1775.773 1134.284 L 1206.966 1445.541 L 1206.966 2067.686 L 1206.966 2067.81 Z M 1838.302 1134.284 L 2407.108 1445.17 L 2407.108 2067.81 L 1838.302 1756.306 L 1838.302 1134.284 Z" fill="#000" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1144.438 1481.645 L 575.631 1792.779 L 575.631 2415.172 L 1144.438 2104.037 L 1144.438 1481.645 Z M 1775.773 443.626 L 1206.966 754.761 L 1206.966 1377.153 L 1775.773 1066.018 L 1775.773 443.626 Z M 1206.966 2067.81 L 1775.773 1756.306 L 1775.773 1134.284 L 1206.966 1445.541 L 1206.966 2067.686 L 1206.966 2067.81 Z M 1838.302 1134.284 L 2407.108 1445.17 L 2407.108 2067.81 L 1838.302 1756.306 L 1838.302 1134.284 Z" fill="#000" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

After

Width:  |  Height:  |  Size: 616 KiB

View file

@ -0,0 +1,2 @@
Containerized development, execution and admin environment for Ansible and Terraform.
Create, provision, visualize and manage infrastructures, schedule maintenance tasks.

View file

@ -0,0 +1,20 @@
[data-md-color-scheme="terraform"] {
--md-primary-fg-color: #241B2F;
--md-primary-fg-color--light: #7747A7;
--md-primary-fg-color--dark: #7747A7;
--md-accent-fg-color: #5C41E2;
--md-default-bg-color: #FFFFFF;
--md-typeset-a-color: #604270;
}
[data-md-color-scheme="terraform-dark"] {
--md-primary-fg-color: #7747A7;
--md-accent-fg-color: #DF736A;
--md-default-bg-color: #171520;
--md-default-fg-color--light: #604270;
--md-typeset-color: #FFFFFF;
--md-typeset-a-color: #83698E;
}

View file

@ -5,14 +5,14 @@
nav:
- Home: README.md
- My apps: pages/my-apps.md
- About: about.md
- Docs: https://docs.alnoda.org/ansible-terraform-workspace/
# ===========================================================
# CONFIGURATION
# ===========================================================
site_name: Infra Workspace
site_name: Ansible-terraform workspace
repo_url: https://github.com/bluxmit/alnoda-workspaces
site_url: https://docs.alnoda.org
edit_uri: ""
@ -23,26 +23,24 @@ edit_uri: ""
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
favicon: 'assets/terraform-circle.svg'
logo: 'assets/terraform-circle-white.svg'
custom_dir: overrides
font:
text: PT Sans
icon:
repo: fontawesome/brands/git-alt
repo: fontawesome/brands/github
features:
- navigation.instant
palette:
- scheme: default
- scheme: terraform
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: red
accent: orange
- scheme: slate
toggle:
icon: material/toggle-switch
icon: material/brightness-7
name: Switch to dark mode
primary: red
accent: orange
- scheme: terraform-dark
toggle:
icon: material/brightness-4
name: Switch to light mode
extra:
# Link to open when your logo is clicked
@ -50,21 +48,14 @@ extra:
host_url: http://docs.alnoda.org
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_css:
- stylesheets/extra.css
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none; fill: rgb(255, 255, 255);" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1144.438 1481.645 L 575.631 1792.779 L 575.631 2415.172 L 1144.438 2104.037 L 1144.438 1481.645 Z M 1775.773 443.626 L 1206.966 754.761 L 1206.966 1377.153 L 1775.773 1066.018 L 1775.773 443.626 Z M 1206.966 2067.81 L 1775.773 1756.306 L 1775.773 1134.284 L 1206.966 1445.541 L 1206.966 2067.686 L 1206.966 2067.81 Z M 1838.302 1134.284 L 2407.108 1445.17 L 2407.108 2067.81 L 1838.302 1756.306 L 1838.302 1134.284 Z" style="fill: rgb(255, 255, 255);"/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1144.438 1481.645 L 575.631 1792.779 L 575.631 2415.172 L 1144.438 2104.037 L 1144.438 1481.645 Z M 1775.773 443.626 L 1206.966 754.761 L 1206.966 1377.153 L 1775.773 1066.018 L 1775.773 443.626 Z M 1206.966 2067.81 L 1775.773 1756.306 L 1775.773 1134.284 L 1206.966 1445.541 L 1206.966 2067.686 L 1206.966 2067.81 Z M 1838.302 1134.284 L 2407.108 1445.17 L 2407.108 2067.81 L 1838.302 1756.306 L 1838.302 1134.284 Z" fill="#000" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -1,10 +1,14 @@
ARG docker_registry=docker.io/alnoda
ARG image_tag=2.2-17
ARG image_tag=3.0-17
FROM ${docker_registry}/java-workspace:${image_tag}
USER root
COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml
COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml
COPY ./mkdocs/elixir-circle.svg /home/docs/docs/assets/
COPY ./mkdocs/elixir-circle-white.svg /home/docs/docs/assets/
COPY ./mkdocs/extra.css /home/docs/docs/stylesheets/
COPY ./mkdocs/about.md /home/docs/docs/about.md
RUN apt-get -y update \
&& echo "------------------------------------------------------ Erlang requirements" \

View file

@ -1,14 +1,11 @@
<p align="center">
<img src="../../img/Alnoda-white.svg" alt="Alnoda logo" width="150">
</p>
<img src="./img/elixir-circle.svg" alt="Elixir logo" width="150">
</p>
# Erlang-Elixir workspace
# Erlang-elixir workspace
Docker image with Erlang, Elixir and browser-based VS-Code version.
Containerized isolated development environment for Erlang and Elixir programming languages.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-collage-sm.jpg" alt="Collage" width="750">
</p>
## Why this images
@ -32,30 +29,23 @@ and open [localhost:8020](http://localhost:8020) in browser.
**Dev tools:**
- [**Code-server**](https://github.com/cdr/code-server) - open source version of popular Visual Studio Code IDE. Codeserver has
VS-Code extensions and works in browser.
- [**Eclipse Theia**](https://theia-ide.org/docs/) - open source version of popular Visual Studio Code IDE. Theia is trully open-source, has
VS-Code extensions and works in browser. This means it can run inside a docker container on local machine or in cloud. A lot of beautiful color themes and many common plugins are already installed to save time.
- [**Terminal**](https://github.com/tsl0922/ttyd) - secure browser-based terminal.
- [**FileBrowser**](https://github.com/filebrowser/filebrowser) - manage files and folders inside the workspace, and exchange data between local environment and the workspace
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
- [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) - create awesome documentation for your project with only markdown.
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
- Quicklaunch UI with getting started tutorial
Image is built from **Ubuntu 20.4** with the additional CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc, xplr
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Ubuntu 20.4** with the following CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Terminal multiplexer:** tmux
## Docs

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<path d="M 2199.285 1182.068 C 2199.285 846.027 1934.813 516.977 1499.78 516.977 C 1025.608 516.977 791.235 849.253 791.235 1259.4 C 791.235 1726.003 1142.841 2419.5 1513.881 2660.822 C 1538.917 2677.131 1571.998 2657.148 1569.107 2627.576 C 1566.395 2599.528 1564.95 2571.031 1564.95 2542.356 C 1564.95 2357.13 1622.887 2185.257 1722.041 2043.853 C 1769.224 1972.612 1820.745 1911.498 1881.393 1833.179 C 1966.357 1723.315 2029.267 1662.469 2120.197 1489.072 C 2120.648 1488.176 2121.1 1487.459 2121.553 1486.563 C 2171.355 1395.429 2199.285 1291.929 2199.285 1182.068 Z" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1 @@
Containerized isolated development environment for Erlang and Elixir programming languages.

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none; fill: rgb(255, 255, 255);" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<path d="M 2199.285 1182.068 C 2199.285 846.027 1934.813 516.977 1499.78 516.977 C 1025.608 516.977 791.235 849.253 791.235 1259.4 C 791.235 1726.003 1142.841 2419.5 1513.881 2660.822 C 1538.917 2677.131 1571.998 2657.148 1569.107 2627.576 C 1566.395 2599.528 1564.95 2571.031 1564.95 2542.356 C 1564.95 2357.13 1622.887 2185.257 1722.041 2043.853 C 1769.224 1972.612 1820.745 1911.498 1881.393 1833.179 C 1966.357 1723.315 2029.267 1662.469 2120.197 1489.072 C 2120.648 1488.176 2121.1 1487.459 2121.553 1486.563 C 2171.355 1395.429 2199.285 1291.929 2199.285 1182.068 Z" style="fill: rgb(255, 255, 255);"/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<path d="M 2199.285 1182.068 C 2199.285 846.027 1934.813 516.977 1499.78 516.977 C 1025.608 516.977 791.235 849.253 791.235 1259.4 C 791.235 1726.003 1142.841 2419.5 1513.881 2660.822 C 1538.917 2677.131 1571.998 2657.148 1569.107 2627.576 C 1566.395 2599.528 1564.95 2571.031 1564.95 2542.356 C 1564.95 2357.13 1622.887 2185.257 1722.041 2043.853 C 1769.224 1972.612 1820.745 1911.498 1881.393 1833.179 C 1966.357 1723.315 2029.267 1662.469 2120.197 1489.072 C 2120.648 1488.176 2121.1 1487.459 2121.553 1486.563 C 2171.355 1395.429 2199.285 1291.929 2199.285 1182.068 Z" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -0,0 +1,20 @@
[data-md-color-scheme="elixir"] {
--md-primary-fg-color: #604270;
--md-primary-fg-color--light: #c9af06;
--md-primary-fg-color--dark: #604270;
--md-accent-fg-color: #07B6AB;
--md-default-bg-color: #FFFFFF;
--md-typeset-a-color: #604270;
}
[data-md-color-scheme="elixir-dark"] {
--md-primary-fg-color: #83698E;
--md-accent-fg-color: #07B6AB;
--md-default-bg-color: #232834;
--md-default-fg-color--light: #604270;
--md-typeset-color: #FFFFFF;
--md-typeset-a-color: #83698E;
}

View file

@ -5,14 +5,14 @@
nav:
- Home: README.md
- My apps: pages/my-apps.md
- About: about.md
- Docs: https://docs.alnoda.org/erlang-elixir-workspace/
# ===========================================================
# CONFIGURATION
# ===========================================================
site_name: Erlang-Elixir workspace
site_name: Erlang-elixir workspace
repo_url: https://github.com/bluxmit/alnoda-workspaces
site_url: https://docs.alnoda.org
edit_uri: ""
@ -23,26 +23,24 @@ edit_uri: ""
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
favicon: 'assets/elixir-circle.svg'
logo: 'assets/elixir-circle-white.svg'
custom_dir: overrides
font:
text: PT Sans
icon:
repo: fontawesome/brands/git-alt
repo: fontawesome/brands/github
features:
- navigation.instant
palette:
- scheme: default
- scheme: elixir
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: deep purple
accent: indigo
- scheme: slate
toggle:
icon: material/toggle-switch
icon: material/brightness-7
name: Switch to dark mode
primary: deep purple
accent: yellow
- scheme: elixir-dark
toggle:
icon: material/brightness-4
name: Switch to light mode
extra:
# Link to open when your logo is clicked
@ -50,21 +48,14 @@ extra:
host_url: http://docs.alnoda.org
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_css:
- stylesheets/extra.css
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View file

@ -1,11 +1,15 @@
ARG docker_registry=docker.io/alnoda
ARG image_tag=2.2
ARG image_tag=3.0
ARG ruby_global_version=3.1.2
FROM ${docker_registry}/codeserver-workspace:${image_tag}
FROM ${docker_registry}/theia-workspace:${image_tag}
USER root
COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml
COPY ./mkdocs/go-circle.svg /home/docs/docs/assets/
COPY ./mkdocs/go-circle-white.svg /home/docs/docs/assets/
COPY ./mkdocs/extra.css /home/docs/docs/stylesheets/
COPY ./mkdocs/about.md /home/docs/docs/about.md
RUN apt-get -y update \
&& echo "------------------------------------------------------ go " \

View file

@ -1,14 +1,10 @@
<p align="center">
<img src="../../img/Alnoda-white.svg" alt="Alnoda logo" width="150">
<img src="./img/go-circle.svg" alt="Go logo" width="150">
</p>
# Go workspace
Docker image with Go and browser-based VS-Code version.
<p align="center">
<img src="https://raw.githubusercontent.com/bluxmit/alnoda-workspaces/main/workspaces/codeserver-workspace/img/codeserver-collage-sm.jpg" alt="Collage" width="750">
</p>
Containerized isolated development environment for Go programming language.
## Why this images
@ -29,30 +25,23 @@ and open [localhost:8020](http://localhost:8020) in browser.
**Dev tools:**
- [**Code-server**](https://github.com/cdr/code-server) - open source version of popular Visual Studio Code IDE. Codeserver has
VS-Code extensions and works in browser.
- [**Eclipse Theia**](https://theia-ide.org/docs/) - open source version of popular Visual Studio Code IDE. Theia is trully open-source, has
VS-Code extensions and works in browser. This means it can run inside a docker container on local machine or in cloud. A lot of beautiful color themes and many common plugins are already installed to save time.
- [**Terminal**](https://github.com/tsl0922/ttyd) - secure browser-based terminal.
- [**FileBrowser**](https://github.com/filebrowser/filebrowser) - manage files and folders inside the workspace, and exchange data between local environment and the workspace
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
- [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) - create awesome documentation for your project with only markdown.
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
- Quicklaunch UI with getting started tutorial
Image is built from **Ubuntu 20.4** with the additional CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc, xplr
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Ubuntu 20.4** with the following CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Terminal multiplexer:** tmux
## Docs

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<path d="M 321.224 1697.227 C 316.056 1697.227 314.847 1699.791 317.375 1703.807 L 344.423 1738.936 C 346.952 1742.839 353.33 1745.403 358.497 1745.403 L 817.219 1745.403 C 822.277 1745.403 823.597 1741.5 821.068 1737.598 L 799.187 1703.807 C 796.658 1699.791 790.17 1696 786.323 1696 L 321.224 1697.227 Z M 127.268 1577.342 C 122.099 1577.342 120.781 1579.907 123.419 1583.811 L 150.358 1619.05 C 152.886 1622.954 159.373 1625.519 164.542 1625.519 L 750.369 1625.519 C 755.535 1625.519 758.065 1621.616 756.745 1617.712 L 746.519 1586.487 C 745.2 1581.245 740.141 1578.68 734.975 1578.68 L 127.268 1577.342 Z M 438.213 1457.458 C 433.046 1457.458 431.726 1461.361 434.365 1465.263 L 452.287 1497.828 C 454.816 1501.732 459.984 1505.634 465.151 1505.634 L 722.11 1505.634 C 727.279 1505.634 729.808 1501.732 729.808 1496.489 L 727.279 1465.263 C 727.279 1460.022 722.11 1456.118 718.261 1456.118 L 438.213 1457.458 Z M 1771.825 1720.646 C 1690.9 1699.791 1635.595 1684.179 1555.989 1663.324 C 1536.638 1658.195 1535.428 1656.857 1518.605 1676.372 C 1499.475 1698.565 1485.29 1712.839 1458.351 1725.888 C 1377.316 1766.258 1298.921 1754.548 1225.803 1706.372 C 1138.391 1649.05 1093.419 1564.294 1094.739 1458.796 C 1095.948 1354.524 1166.648 1268.542 1268.134 1254.156 C 1355.546 1242.445 1428.664 1273.671 1486.61 1340.138 C 1498.154 1354.524 1508.38 1370.136 1521.244 1388.426 L 1273.301 1388.426 C 1246.363 1388.426 1239.876 1405.377 1248.892 1427.458 C 1265.605 1467.829 1296.391 1535.633 1314.423 1569.535 C 1320.051 1582.373 1332.679 1590.576 1346.53 1590.39 L 1814.158 1590.39 C 1811.629 1555.149 1811.629 1520.02 1806.461 1484.78 C 1793.151 1392.004 1756.915 1304.151 1701.127 1229.397 C 1608.656 1105.61 1487.819 1028.66 1334.985 1007.917 C 1209.088 990.967 1092.101 1015.724 989.404 1093.789 C 894.295 1166.835 840.309 1263.3 826.235 1383.184 C 809.523 1525.263 850.644 1652.953 935.418 1765.031 C 1026.679 1886.142 1147.406 1963.091 1295.182 1990.414 C 1415.91 2012.607 1531.58 1998.221 1635.595 1926.624 C 1703.765 1880.901 1752.474 1818.449 1784.69 1742.839 C 1792.388 1731.129 1787.219 1724.55 1771.825 1720.646 M 2197.121 1000 C 2080.132 1002.676 1973.478 1036.579 1883.537 1114.755 C 1808.715 1178.714 1759.394 1268.1 1744.778 1366.234 C 1721.687 1513.44 1761.49 1643.809 1848.903 1759.789 C 1942.692 1884.916 2055.722 1950.043 2208.667 1977.366 C 2339.731 2000.786 2463.096 1987.85 2574.808 1910.9 C 2676.294 1840.642 2739.297 1745.403 2756.01 1620.388 C 2777.781 1444.41 2727.753 1301.105 2608.234 1178.544 C 2523.46 1091.224 2419.335 1036.579 2299.818 1011.821 C 2265.182 1005.242 2230.547 1004.016 2197.121 1000 Z M 2502.789 1526.489 C 2501.579 1543.44 2501.579 1556.488 2499.051 1569.535 C 2475.961 1698.565 2358.971 1771.499 2236.925 1742.839 C 2117.407 1715.515 2040.33 1638.567 2012.072 1516.118 C 1988.982 1414.41 2037.801 1311.478 2130.271 1269.768 C 2200.971 1238.542 2271.559 1242.445 2339.731 1277.575 C 2441.216 1331.105 2496.413 1414.41 2502.9 1526.489 L 2502.789 1526.489 Z" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -0,0 +1 @@
Containerized isolated development environment for Go programming language.

View file

@ -0,0 +1,20 @@
[data-md-color-scheme="go"] {
--md-primary-fg-color: #007D9C;
--md-primary-fg-color--light: #c9af06;
--md-primary-fg-color--dark: #DC322F;
--md-accent-fg-color: #c9af06;
--md-default-bg-color: #FFFFFF;
--md-typeset-a-color: #007D9C;
}
[data-md-color-scheme="go-dark"] {
--md-primary-fg-color: #007D9C;
--md-accent-fg-color: #c9af06;
--md-default-bg-color: #010d14;
--md-default-fg-color--light: #c9af06;
--md-typeset-color: #FFFFFF;
--md-typeset-a-color: #79D4FD;
}

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none; fill: rgb(255, 255, 255);" id="path14"/>
<title>Go icon</title>
<path d="M 321.224 1697.227 C 316.056 1697.227 314.847 1699.791 317.375 1703.807 L 344.423 1738.936 C 346.952 1742.839 353.33 1745.403 358.497 1745.403 L 817.219 1745.403 C 822.277 1745.403 823.597 1741.5 821.068 1737.598 L 799.187 1703.807 C 796.658 1699.791 790.17 1696 786.323 1696 L 321.224 1697.227 Z M 127.268 1577.342 C 122.099 1577.342 120.781 1579.907 123.419 1583.811 L 150.358 1619.05 C 152.886 1622.954 159.373 1625.519 164.542 1625.519 L 750.369 1625.519 C 755.535 1625.519 758.065 1621.616 756.745 1617.712 L 746.519 1586.487 C 745.2 1581.245 740.141 1578.68 734.975 1578.68 L 127.268 1577.342 Z M 438.213 1457.458 C 433.046 1457.458 431.726 1461.361 434.365 1465.263 L 452.287 1497.828 C 454.816 1501.732 459.984 1505.634 465.151 1505.634 L 722.11 1505.634 C 727.279 1505.634 729.808 1501.732 729.808 1496.489 L 727.279 1465.263 C 727.279 1460.022 722.11 1456.118 718.261 1456.118 L 438.213 1457.458 Z M 1771.825 1720.646 C 1690.9 1699.791 1635.595 1684.179 1555.989 1663.324 C 1536.638 1658.195 1535.428 1656.857 1518.605 1676.372 C 1499.475 1698.565 1485.29 1712.839 1458.351 1725.888 C 1377.316 1766.258 1298.921 1754.548 1225.803 1706.372 C 1138.391 1649.05 1093.419 1564.294 1094.739 1458.796 C 1095.948 1354.524 1166.648 1268.542 1268.134 1254.156 C 1355.546 1242.445 1428.664 1273.671 1486.61 1340.138 C 1498.154 1354.524 1508.38 1370.136 1521.244 1388.426 L 1273.301 1388.426 C 1246.363 1388.426 1239.876 1405.377 1248.892 1427.458 C 1265.605 1467.829 1296.391 1535.633 1314.423 1569.535 C 1320.051 1582.373 1332.679 1590.576 1346.53 1590.39 L 1814.158 1590.39 C 1811.629 1555.149 1811.629 1520.02 1806.461 1484.78 C 1793.151 1392.004 1756.915 1304.151 1701.127 1229.397 C 1608.656 1105.61 1487.819 1028.66 1334.985 1007.917 C 1209.088 990.967 1092.101 1015.724 989.404 1093.789 C 894.295 1166.835 840.309 1263.3 826.235 1383.184 C 809.523 1525.263 850.644 1652.953 935.418 1765.031 C 1026.679 1886.142 1147.406 1963.091 1295.182 1990.414 C 1415.91 2012.607 1531.58 1998.221 1635.595 1926.624 C 1703.765 1880.901 1752.474 1818.449 1784.69 1742.839 C 1792.388 1731.129 1787.219 1724.55 1771.825 1720.646 M 2197.121 1000 C 2080.132 1002.676 1973.478 1036.579 1883.537 1114.755 C 1808.715 1178.714 1759.394 1268.1 1744.778 1366.234 C 1721.687 1513.44 1761.49 1643.809 1848.903 1759.789 C 1942.692 1884.916 2055.722 1950.043 2208.667 1977.366 C 2339.731 2000.786 2463.096 1987.85 2574.808 1910.9 C 2676.294 1840.642 2739.297 1745.403 2756.01 1620.388 C 2777.781 1444.41 2727.753 1301.105 2608.234 1178.544 C 2523.46 1091.224 2419.335 1036.579 2299.818 1011.821 C 2265.182 1005.242 2230.547 1004.016 2197.121 1000 Z M 2502.789 1526.489 C 2501.579 1543.44 2501.579 1556.488 2499.051 1569.535 C 2475.961 1698.565 2358.971 1771.499 2236.925 1742.839 C 2117.407 1715.515 2040.33 1638.567 2012.072 1516.118 C 1988.982 1414.41 2037.801 1311.478 2130.271 1269.768 C 2200.971 1238.542 2271.559 1242.445 2339.731 1277.575 C 2441.216 1331.105 2496.413 1414.41 2502.9 1526.489 L 2502.789 1526.489 Z" style="fill: rgb(255, 255, 255);"/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<path d="M 321.224 1697.227 C 316.056 1697.227 314.847 1699.791 317.375 1703.807 L 344.423 1738.936 C 346.952 1742.839 353.33 1745.403 358.497 1745.403 L 817.219 1745.403 C 822.277 1745.403 823.597 1741.5 821.068 1737.598 L 799.187 1703.807 C 796.658 1699.791 790.17 1696 786.323 1696 L 321.224 1697.227 Z M 127.268 1577.342 C 122.099 1577.342 120.781 1579.907 123.419 1583.811 L 150.358 1619.05 C 152.886 1622.954 159.373 1625.519 164.542 1625.519 L 750.369 1625.519 C 755.535 1625.519 758.065 1621.616 756.745 1617.712 L 746.519 1586.487 C 745.2 1581.245 740.141 1578.68 734.975 1578.68 L 127.268 1577.342 Z M 438.213 1457.458 C 433.046 1457.458 431.726 1461.361 434.365 1465.263 L 452.287 1497.828 C 454.816 1501.732 459.984 1505.634 465.151 1505.634 L 722.11 1505.634 C 727.279 1505.634 729.808 1501.732 729.808 1496.489 L 727.279 1465.263 C 727.279 1460.022 722.11 1456.118 718.261 1456.118 L 438.213 1457.458 Z M 1771.825 1720.646 C 1690.9 1699.791 1635.595 1684.179 1555.989 1663.324 C 1536.638 1658.195 1535.428 1656.857 1518.605 1676.372 C 1499.475 1698.565 1485.29 1712.839 1458.351 1725.888 C 1377.316 1766.258 1298.921 1754.548 1225.803 1706.372 C 1138.391 1649.05 1093.419 1564.294 1094.739 1458.796 C 1095.948 1354.524 1166.648 1268.542 1268.134 1254.156 C 1355.546 1242.445 1428.664 1273.671 1486.61 1340.138 C 1498.154 1354.524 1508.38 1370.136 1521.244 1388.426 L 1273.301 1388.426 C 1246.363 1388.426 1239.876 1405.377 1248.892 1427.458 C 1265.605 1467.829 1296.391 1535.633 1314.423 1569.535 C 1320.051 1582.373 1332.679 1590.576 1346.53 1590.39 L 1814.158 1590.39 C 1811.629 1555.149 1811.629 1520.02 1806.461 1484.78 C 1793.151 1392.004 1756.915 1304.151 1701.127 1229.397 C 1608.656 1105.61 1487.819 1028.66 1334.985 1007.917 C 1209.088 990.967 1092.101 1015.724 989.404 1093.789 C 894.295 1166.835 840.309 1263.3 826.235 1383.184 C 809.523 1525.263 850.644 1652.953 935.418 1765.031 C 1026.679 1886.142 1147.406 1963.091 1295.182 1990.414 C 1415.91 2012.607 1531.58 1998.221 1635.595 1926.624 C 1703.765 1880.901 1752.474 1818.449 1784.69 1742.839 C 1792.388 1731.129 1787.219 1724.55 1771.825 1720.646 M 2197.121 1000 C 2080.132 1002.676 1973.478 1036.579 1883.537 1114.755 C 1808.715 1178.714 1759.394 1268.1 1744.778 1366.234 C 1721.687 1513.44 1761.49 1643.809 1848.903 1759.789 C 1942.692 1884.916 2055.722 1950.043 2208.667 1977.366 C 2339.731 2000.786 2463.096 1987.85 2574.808 1910.9 C 2676.294 1840.642 2739.297 1745.403 2756.01 1620.388 C 2777.781 1444.41 2727.753 1301.105 2608.234 1178.544 C 2523.46 1091.224 2419.335 1036.579 2299.818 1011.821 C 2265.182 1005.242 2230.547 1004.016 2197.121 1000 Z M 2502.789 1526.489 C 2501.579 1543.44 2501.579 1556.488 2499.051 1569.535 C 2475.961 1698.565 2358.971 1771.499 2236.925 1742.839 C 2117.407 1715.515 2040.33 1638.567 2012.072 1516.118 C 1988.982 1414.41 2037.801 1311.478 2130.271 1269.768 C 2200.971 1238.542 2271.559 1242.445 2339.731 1277.575 C 2441.216 1331.105 2496.413 1414.41 2502.9 1526.489 L 2502.789 1526.489 Z" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

View file

@ -5,9 +5,9 @@
nav:
- Home: README.md
- My apps: pages/my-apps.md
- About: about.md
- Docs: https://docs.alnoda.org/go-workspace/
# ===========================================================
# CONFIGURATION
# ===========================================================
@ -23,26 +23,24 @@ edit_uri: ""
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
favicon: 'assets/go-circle.svg'
logo: 'assets/go-circle-white.svg'
custom_dir: overrides
font:
text: Open Sans
icon:
repo: fontawesome/brands/git-alt
repo: fontawesome/brands/github
features:
- navigation.instant
palette:
- scheme: default
- scheme: go
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: light blue
accent: light blue
- scheme: slate
toggle:
icon: material/toggle-switch
icon: material/brightness-7
name: Switch to dark mode
primary: light blue
accent: light blue
- scheme: go-dark
toggle:
icon: material/brightness-4
name: Switch to light mode
extra:
# Link to open when your logo is clicked
@ -50,21 +48,13 @@ extra:
host_url: http://docs.alnoda.org
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_css:
- stylesheets/extra.css
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View file

@ -0,0 +1,20 @@
[data-md-color-scheme="k8s"] {
--md-primary-fg-color: #316CE6;
--md-primary-fg-color--light: #7747A7;
--md-primary-fg-color--dark: #7747A7;
--md-accent-fg-color: #1040a1;
--md-default-bg-color: #FFFFFF;
--md-typeset-a-color: #303030;
}
[data-md-color-scheme="k8s-dark"] {
--md-primary-fg-color: #316CE6;
--md-accent-fg-color: #DF736A;
--md-default-bg-color: #232834;
--md-default-fg-color--light: #E3EAF2;
--md-typeset-color: #E3EAF2;
--md-typeset-a-color: #E3EAF2;
}

View file

@ -5,9 +5,9 @@
nav:
- Home: README.md
- My apps: pages/my-apps.md
- About: about.md
- Docs: https://docs.alnoda.org/kubespray-workspace/
# ===========================================================
# CONFIGURATION
# ===========================================================
@ -23,26 +23,24 @@ edit_uri: ""
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
favicon: 'assets/k8s-circle.svg'
logo: 'assets/k8s-circle-white.svg'
custom_dir: overrides
font:
text: Roboto
icon:
repo: fontawesome/brands/git-alt
repo: fontawesome/brands/github
features:
- navigation.instant
palette:
- scheme: default
- scheme: k8s
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: indigo
accent: blue
- scheme: slate
toggle:
icon: material/toggle-switch
icon: material/brightness-7
name: Switch to dark mode
primary: indigo
accent: blue
- scheme: k8s-dark
toggle:
icon: material/brightness-4
name: Switch to light mode
extra:
# Link to open when your logo is clicked
@ -50,21 +48,14 @@ extra:
host_url: http://docs.alnoda.org
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_css:
- stylesheets/extra.css
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View file

@ -1,15 +1,20 @@
ARG docker_registry=docker.io/alnoda
ARG image_tag=2.2
ARG image_tag=3.0
FROM ${docker_registry}/base-workspace:${image_tag}
USER root
COPY supervisord-rstudio.conf /etc/supervisord/
# COPY supervisord-rstudio.conf /etc/supervisord/
COPY rocker_scripts /rocker_scripts
COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml
COPY ./mkdocs/helpers.py /home/docs/macros
COPY ./mkdocs/RStudio.png /home/docs/docs/assets/home/
COPY ./mkdocs/README.md /home/docs/docs/README.md
COPY ./mkdocs/r-circle.svg /home/docs/docs/assets/
COPY ./mkdocs/r-circle-white.svg /home/docs/docs/assets/
COPY ./mkdocs/extra.css /home/docs/docs/stylesheets/
COPY ./mkdocs/about.md /home/docs/docs/about.md
### R
ENV R_VERSION=4.2.0 \
@ -26,18 +31,19 @@ ENV R_VERSION=4.2.0 \
ENV PATH=/usr/local/bin/:$PATH
ENV PATH=/usr/lib/rstudio-server/bin:$PATH
RUN cd /tmp && git clone https://github.com/rocker-org/rocker-versioned2.git \
&& mv /tmp/rocker-versioned2/scripts /rocker_scripts \
RUN echo "------------------------------------------------------ R & R-Studio" \
&& find /rocker_scripts/ -type f -iname "*.sh" -exec chmod +x {} \; \
&& bash /rocker_scripts/install_R_source.sh \
&& bash /rocker_scripts/setup_R.sh \
&& mkdir /var/log/rstudio \
&& bash /rocker_scripts/install_rstudio.sh \
&& rstudio-server stop || true \
&& rstudio-server stop \
&& rm -rf /rocker_scripts \
&& echo "------------------------------------------------------ user" \
&& chown -R abc /etc/rstudio \
&& chown -R abc /usr/lib/rstudio-server \
&& chown -R abc /var/lib/rstudio-server \
&& chown -R abc /var/log/rstudio \
&& chown -R abc /var/log/rstudio \
&& chown -R abc /usr/local/lib/R \
&& mkdir /home/abc/.rserver && chown -R abc /home/abc/.rserver \
&& find /home -type d | xargs -I{} chown -R abc {} \
@ -45,7 +51,7 @@ RUN cd /tmp && git clone https://github.com/rocker-org/rocker-versioned2.git \
USER abc
COPY rstudio/database.conf /home/abc/.rserver
COPY rstudio/database.conf /home/abc/.rserver/
ENV USER=abc
RUN echo "------------------------------------------------------ some cleaning because Rstudio workdir is /home/abc/" \

View file

@ -1,10 +1,11 @@
<p align="center">
<img src="../../img/Alnoda-white.svg" alt="Alnoda logo" width="150">
<img src="./img/r-circle.svg" alt="R logo" width="150">
</p>
# R workspace
Docker image with R and browser-based RStudio version.
Development and execution environment for R programming language.
Experiment, prototype, code and schedule executions.
<p align="center">
<img src="img/r-workspace-collage.png" alt="Collage" width="750">
@ -34,26 +35,19 @@ and open [localhost:8020](http://localhost:8020) in browser.
- **RStudio server** - open source version of popular R IDE, browser-based.
- [**Terminal**](https://github.com/tsl0922/ttyd) - secure browser-based terminal.
- [**FileBrowser**](https://github.com/filebrowser/filebrowser) - manage files and folders inside the workspace, and exchange data between local environment and the workspace
- [**Cronicle**](https://github.com/jhuckaby/Cronicle) - task scheduler and runner, with a web based front-end UI. It handles both scheduled, repeating and on-demand jobs, targeting any number of worker servers, with real-time stats and live log viewer.
- [**Static File Server**](https://github.com/vercel/serve) - view any static html sites as easy as if you do it on your local machine. Serve static websites easily.
- [**Ungit**](https://github.com/FredrikNoren/ungit) - rings user friendliness to git without sacrificing the versatility of it.
- [**MkDocs**](https://squidfunk.github.io/mkdocs-material/) - create awesome documentation for your project with only markdown.
- [**Midnight Commander**](https://midnight-commander.org/) - Feature rich visual file manager with internal text viewer and editor.
- [**Process Monitor**](https://htop.dev/) - Monitor running process and resource utilization.
- Quicklaunch UI with getting started tutorial
Image is built from **Ubuntu 20.4** with the additional CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc, xplr
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Ubuntu 20.4** with the following CLI apps
- [Zsh](https://www.zsh.org/), [Oh my Zsh](https://ohmyz.sh/)
- Python 3, Pip
- Node/nodeenv
- curl, wget, telnet, jq
- **Git:** git, git-flow, lazygit
- **File browsers:** mc
- **Text editors:** nano, vim, mcedit
- **System monitors:** ncdu, htop, glances, vizex
- **Process Control:** supervisord
- **Job scheduler:** cron
- **Terminal multiplexer:** tmux
## Docs

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1424.331 890.177 C 780.038 890.177 257.663 1220.571 257.663 1628.193 C 257.663 2035.816 780.038 2366.213 1424.331 2366.213 C 2068.621 2366.213 2590.997 2035.724 2590.997 1628.193 C 2590.997 1220.664 2068.621 890.177 1424.331 890.177 Z M 1602.929 2077.688 C 1113.123 2077.688 716.164 1851.794 716.164 1573.099 C 716.164 1294.4 1113.123 1068.598 1602.83 1068.598 C 2092.539 1068.598 2454.109 1223.05 2454.109 1573.099 C 2454.109 1923.144 2092.637 2077.688 1602.929 2077.688 Z M 2034.4 1223.143 C 2072.548 1212.295 2109.87 1199.011 2146.109 1183.382 C 2167.03 1173.619 2186.14 1160.719 2202.691 1145.181 C 2213.114 1134.737 2221.829 1122.882 2228.553 1110.011 L 2506.9 666.85 L 2057.052 666.667 L 1846.76 1039.762 C 1827.347 1072.275 1803.985 1102.537 1777.152 1129.939 C 1763.524 1144.28 1744.176 1152.601 1723.774 1152.895 L 1616.929 1152.895 L 1616.929 666.944 L 1218.998 666.85 L 1218.998 1907.9 L 2018.261 1907.9 C 2018.261 1907.9 2382.261 1901.748 2382.261 1574.567 C 2382.92 1388.98 2230.489 1234.99 2034.4 1223.143 Z M 1861.345 1638.754 L 1620.332 1638.845 L 1620.332 1427.826 L 1861.345 1427.826 C 1924.161 1427.064 1974.957 1475.957 1972.955 1535.265 C 1976.477 1594.518 1924.004 1643.173 1861.345 1638.754 Z" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1,2 @@
Development and execution environment for R programming language.
Experiment, prototype, code and schedule executions.

View file

@ -0,0 +1,20 @@
[data-md-color-scheme="r"] {
--md-primary-fg-color: #1B5FAF;
--md-default-fg-color--light: #1B5FAF;
--md-default-fg-color--dark: #604270;
--md-accent-fg-color: #1B5FAF;
--md-default-bg-color: #FFFFFF;
--md-typeset-a-color: #B4B4B7;
}
[data-md-color-scheme="r-dark"] {
--md-primary-fg-color: #8492BA;
--md-accent-fg-color: #8492BA;
--md-default-bg-color: #3C3C3C;
--md-default-fg-color--light: #8492BA;
--md-typeset-color: #FFFFFF;
--md-typeset-a-color: #B4B4B7;
}

View file

@ -5,9 +5,9 @@
nav:
- Home: README.md
- My apps: pages/my-apps.md
- About: about.md
- Docs: https://docs.alnoda.org/r-workspace/
# ===========================================================
# CONFIGURATION
# ===========================================================
@ -23,26 +23,24 @@ edit_uri: ""
theme:
name: 'material'
favicon: 'assets/favicon.ico'
logo: 'assets/Alnoda-logo.svg'
favicon: 'assets/r-circle.svg'
logo: 'assets/r-circle-white.svg'
custom_dir: overrides
font:
text: PT Sans
icon:
repo: fontawesome/brands/git-alt
repo: fontawesome/brands/github
features:
- navigation.instant
palette:
- scheme: default
- scheme: r
toggle:
icon: material/toggle-switch-off-outline
name: Switch to light mode
primary: white
accent: blue
- scheme: slate
toggle:
icon: material/toggle-switch
icon: material/brightness-7
name: Switch to dark mode
primary: white
accent: blue
- scheme: r-dark
toggle:
icon: material/brightness-4
name: Switch to light mode
extra:
# Link to open when your logo is clicked
@ -50,21 +48,14 @@ extra:
host_url: http://docs.alnoda.org
plugins:
- search
# Enable Macros and jinja2 templates
- macros:
module_name: macros/helpers
extra_css:
- stylesheets/extra.css
extra_javascript:
- javascripts/config.js
- https://polyfill.io/v3/polyfill.min.js?features=es6

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none; fill: rgb(255, 255, 255);" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1424.331 890.177 C 780.038 890.177 257.663 1220.571 257.663 1628.193 C 257.663 2035.816 780.038 2366.213 1424.331 2366.213 C 2068.621 2366.213 2590.997 2035.724 2590.997 1628.193 C 2590.997 1220.664 2068.621 890.177 1424.331 890.177 Z M 1602.929 2077.688 C 1113.123 2077.688 716.164 1851.794 716.164 1573.099 C 716.164 1294.4 1113.123 1068.598 1602.83 1068.598 C 2092.539 1068.598 2454.109 1223.05 2454.109 1573.099 C 2454.109 1923.144 2092.637 2077.688 1602.929 2077.688 Z M 2034.4 1223.143 C 2072.548 1212.295 2109.87 1199.011 2146.109 1183.382 C 2167.03 1173.619 2186.14 1160.719 2202.691 1145.181 C 2213.114 1134.737 2221.829 1122.882 2228.553 1110.011 L 2506.9 666.85 L 2057.052 666.667 L 1846.76 1039.762 C 1827.347 1072.275 1803.985 1102.537 1777.152 1129.939 C 1763.524 1144.28 1744.176 1152.601 1723.774 1152.895 L 1616.929 1152.895 L 1616.929 666.944 L 1218.998 666.85 L 1218.998 1907.9 L 2018.261 1907.9 C 2018.261 1907.9 2382.261 1901.748 2382.261 1574.567 C 2382.92 1388.98 2230.489 1234.99 2034.4 1223.143 Z M 1861.345 1638.754 L 1620.332 1638.845 L 1620.332 1427.826 L 1861.345 1427.826 C 1924.161 1427.064 1974.957 1475.957 1972.955 1535.265 C 1976.477 1594.518 1924.004 1643.173 1861.345 1638.754 Z" style="fill: rgb(255, 255, 255);"/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<svg viewBox="0 0 900 900" xmlns="http://www.w3.org/2000/svg">
<g id="g10" transform="matrix(3, 0, 0, -3, 0, 900)" style="">
<g id="g12" transform="scale(0.1)">
<path d="M 1500 3000 C 671.57 3000 0 2328.43 0 1500 C 0 671.57 671.57 0 1500 0 C 2328.43 0 3000 671.57 3000 1500 C 3000 2328.43 2328.43 3000 1500 3000 Z M 2454.59 545.41 C 2199.61 290.422 1860.6 150 1500 150 C 1139.4 150 800.387 290.422 545.406 545.41 C 290.426 800.391 150 1139.4 150 1500 C 150 1860.6 290.426 2199.61 545.406 2454.59 C 800.387 2709.57 1139.4 2850 1500 2850 C 1860.6 2850 2199.61 2709.57 2454.59 2454.59 C 2709.57 2199.61 2850 1860.6 2850 1500 C 2850 1139.4 2709.57 800.391 2454.59 545.41" style="fill-opacity: 1; fill-rule: nonzero; stroke: none;" id="path14"/>
<title>Go icon</title>
<title>Elixir icon</title>
<title>R icon</title>
<path d="M 1424.331 890.177 C 780.038 890.177 257.663 1220.571 257.663 1628.193 C 257.663 2035.816 780.038 2366.213 1424.331 2366.213 C 2068.621 2366.213 2590.997 2035.724 2590.997 1628.193 C 2590.997 1220.664 2068.621 890.177 1424.331 890.177 Z M 1602.929 2077.688 C 1113.123 2077.688 716.164 1851.794 716.164 1573.099 C 716.164 1294.4 1113.123 1068.598 1602.83 1068.598 C 2092.539 1068.598 2454.109 1223.05 2454.109 1573.099 C 2454.109 1923.144 2092.637 2077.688 1602.929 2077.688 Z M 2034.4 1223.143 C 2072.548 1212.295 2109.87 1199.011 2146.109 1183.382 C 2167.03 1173.619 2186.14 1160.719 2202.691 1145.181 C 2213.114 1134.737 2221.829 1122.882 2228.553 1110.011 L 2506.9 666.85 L 2057.052 666.667 L 1846.76 1039.762 C 1827.347 1072.275 1803.985 1102.537 1777.152 1129.939 C 1763.524 1144.28 1744.176 1152.601 1723.774 1152.895 L 1616.929 1152.895 L 1616.929 666.944 L 1218.998 666.85 L 1218.998 1907.9 L 2018.261 1907.9 C 2018.261 1907.9 2382.261 1901.748 2382.261 1574.567 C 2382.92 1388.98 2230.489 1234.99 2034.4 1223.143 Z M 1861.345 1638.754 L 1620.332 1638.845 L 1620.332 1427.826 L 1861.345 1427.826 C 1924.161 1427.064 1974.957 1475.957 1972.955 1535.265 C 1976.477 1594.518 1924.004 1643.173 1861.345 1638.754 Z" style=""/>
</g>
</g>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
<g transform="matrix(2.18986, 0, 0, 2.141408, 100, 100)" style=""/>
</svg>

After

Width:  |  Height:  |  Size: 3.1 KiB

View file

@ -0,0 +1 @@
v2.1.0.2

View file

@ -0,0 +1,155 @@
#!/usr/bin/env r
#
# A second example to install one or more packages, now with option parsing
#
# Copyright (C) 2011 - 2014 Dirk Eddelbuettel
# Copyright (C) 2014 - 2017 Carl Boettiger and Dirk Eddelbuettel
# Copyright (C) 2018 Carl Boettiger, Dirk Eddelbuettel, and Brandon Bertelsen
#
# Released under GPL (>= 2)
## load docopt package from CRAN
library(docopt)
## configuration for docopt
doc <- "Usage: install2.r [-l LIBLOC] [-h] [-x] [-s] [-d DEPS] [-n NCPUS] [-r REPOS...] [-m METHOD] [--error] [--skipmissing] [--] [PACKAGES ...]
-l --libloc LIBLOC location in which to install [default: /usr/local/lib/R/site-library]
-d --deps DEPS install suggested dependencies as well [default: NA]
-n --ncpus NCPUS number of processes to use for parallel install [default: getOption]
-r --repos REPOS repositor(y|ies) to use, or NULL for file [default: getOption]
-e --error throw error and halt instead of a warning [default: FALSE]
--skipmissing use with the --error option, skip the packages missing error [default: FALSE]
-s --skipinstalled skip installing already installed packages [default: FALSE]
-m --method METHOD method to be used for downloading files [default: auto]
-h --help show this help text
-x --usage show help and short example usage"
opt <- docopt(doc) # docopt parsing
if (opt$usage) {
cat(doc, "\n\n")
cat("where PACKAGES... can be one or more CRAN package names, or local (binary or source)
package files (where extensions .tar.gz, .tgz and .zip are recognised). Optional
arguments understood by R CMD INSTALL can be passed interspersed in the PACKAGES, though
this requires use of '--'.
Examples:
install2.r -l /tmp/lib Rcpp BH # install into given library
install2.r -- --with-keep.source drat # keep the source
install2.r -- --data-compress=bzip2 stringdist # prefer bz2 compression
install2.r \".\" # install package in current directory
install2.r -n 6 ggplot2 # parallel install: (6 processes)
install2.r is part of littler which brings 'r' to the command-line.
See http://dirk.eddelbuettel.com/code/littler.html for more information.\n")
q("no")
}
if (opt$deps == "TRUE" || opt$deps == "FALSE") {
opt$deps <- as.logical(opt$deps)
} else if (opt$deps == "NA") {
opt$deps <- NA
}
## docopt results are characters, so if we meant NULL we have to set NULL
if (length(opt$repos) == 1 && "NULL" %in% opt$repos) {
opt$repos <- NULL
}
if ("getOption" %in% opt$repos) {
## as littler can now read ~/.littler.r and/or /etc/littler.r we can preset elsewhere
opt$repos <- c(opt$repos[which(opt$repos != "getOption")], getOption("repos"))
}
if (opt$ncpus == "getOption") {
opt$ncpus <- getOption("Ncpus", 1L)
} else if (opt$ncpus == "-1") {
## parallel comes with R 2.14+
opt$ncpus <- max(1L, parallel::detectCores())
}
## ensure installation is stripped
Sys.setenv("_R_SHLIB_STRIP_"="true")
install_packages2 <- function(pkgs, ..., error = FALSE, skipmissing = FALSE, skipinstalled = FALSE) {
e <- NULL
capture <- function(e) {
if (error) {
catch <-
grepl("download of package .* failed", e$message) ||
(grepl("(dependenc|package).*(is|are) not available", e$message) && !skipmissing) ||
grepl("installation of package.*had non-zero exit status", e$message) ||
grepl("installation of one or more packages failed", e$message)
if (catch) {
e <<- e
}
}
}
if (skipinstalled) {
pkgs <- setdiff(pkgs, installed.packages()[,1])
}
if (length(pkgs) > 0) {
withCallingHandlers(install.packages(pkgs, ...), warning = capture)
if (!is.null(e)) {
stop(e$message, call. = FALSE)
}
}
}
## helper function to for existing files with matching extension
isMatchingFile <- function(f) (file.exists(f) && grepl("(\\.tar\\.gz|\\.tgz|\\.zip)$", f)) || (f == ".")
## helper function which switches to local (ie NULL) repo if matching file is presented
installArg <- function(f, lib, rep, dep, iopts, error, skipmissing, skipinstalled, ncpus, method) {
install_packages2(pkgs=f,
lib=lib,
repos=if (isMatchingFile(f)) NULL else rep,
dependencies=dep,
INSTALL_opts=iopts,
Ncpus = ncpus,
method = method,
error = error,
skipmissing = skipmissing,
skipinstalled = skipinstalled)
}
## strip out arguments to be passed to R CMD INSTALL
isArg <- grepl('^--',opt$PACKAGES)
installOpts <- opt$PACKAGES[isArg]
opt$PACKAGES <- opt$PACKAGES[!isArg]
if (length(opt$PACKAGES)==0 && file.exists("DESCRIPTION") && file.exists("NAMESPACE")) {
## we are in a source directory, so build it
message("* installing *source* package found in current working directory ...")
opt$PACKAGES <- "."
}
## helper function to for existing files with matching extension
isMatchingFile <-
function(f) (file.exists(f) &&
grepl("(\\.tar\\.gz|\\.tgz|\\.zip)$", f)) || (f == ".")
## check arguments for local files -- if none, then we can pass vector on
isLocal <- sapply(opt$PACKAGES, isMatchingFile)
## for any local sources loop explicitly as before, otherwise for remote
## packages pass vector to install_packages2 which does the rest (and
## possibly in parallel using up to ncpus)
if (any(isLocal)) {
sapply(opt$PACKAGES, installArg, opt$libloc, opt$repos, opt$deps,
installOpts, opt$error, opt$skipmissing, opt$skipinstalled, opt$ncpus, opt$method)
} else {
install_packages2(pkgs = opt$PACKAGES,
lib = opt$libloc,
repos = opt$repos,
dependencies = opt$deps,
INSTALL_opts = installOpts,
Ncpus = opt$ncpus,
method = opt$method,
error = opt$error,
skipmissing = opt$skipmissing,
skipinstalled = opt$skipinstalled)
}
## clean up any temp file containing CRAN directory information
sapply(list.files(path=tempdir(), pattern="^(repos|libloc).*\\.rds$", full.names=TRUE), unlink)

View file

@ -0,0 +1,56 @@
#!/bin/bash
set -e
## CUDA environmental variables configuration for RStudio
## These should be exported as ENV vars too
CUDA_HOME=${CUDA_HOME:-/usr/local/cuda}
PATH={$PATH:-$PATH:$CUDA_HOME/bin}
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-$LD_LIBRARY_PATH:$CUDA_HOME/lib64:$CUDA_HOME/extras/CUPTI/lib64}
NVBLAS_CONFIG_FILE=${NVBLAS_CONFIG_FILE:-/etc/nvblas.conf}
## cli R inherits these, but RStudio needs to have these set in as follows:
## (From https://tensorflow.rstudio.com/tools/local_gpu.html#environment-variables)
echo "CUDA_HOME=$CUDA_HOME" >> ${R_HOME}/etc/Renviron.site
echo "PATH=$PATH" >> ${R_HOME}/etc/Renviron.site
if test -f /etc/rstudio/rserver.conf; then
sed -i '/^rsession-ld-library-path/d' /etc/rstudio/rserver.conf
echo "rsession-ld-library-path=$LD_LIBRARY_PATH" >> /etc/rstudio/rserver.conf
fi
## nvblas configuration
touch /var/log/nvblas.log && chown :staff /var/log/nvblas.log
chmod a+rw /var/log/nvblas.log
## Configure R & RStudio to use drop-in CUDA blas
## Allow R to use CUDA for BLAS, with fallback on openblas
## NOTE: NVBLAS_CPU_BLAS_LIB must be correct for UBUNTU_VERSION selected in scripts/install_R.sh#L25
echo 'NVBLAS_LOGFILE /var/log/nvblas.log
NVBLAS_CPU_BLAS_LIB /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
NVBLAS_GPU_LIST ALL' > /etc/nvblas.conf
echo "NVBLAS_CONFIG_FILE=$NVBLAS_CONFIG_FILE" >> ${R_HOME}/etc/Renviron.site
## We don't want to set LD_PRELOAD globally
##ENV LD_PRELOAD=/usr/local/cuda/lib64/libnvblas.so
#
### Instead, we will set it before calling R, Rscript, or RStudio:
#mv /usr/bin/R /usr/bin/R_
#mv /usr/bin/Rscript /usr/bin/Rscript_
#
#echo '\#!/bin/sh \
# \n LD_PRELOAD=/usr/local/cuda/lib64/libnvblas.so /usr/bin/R_ "$@"' \
# > /usr/bin/R && \
# chmod +x /usr/bin/R && \
# echo '#!/bin/sh \
# \n LD_PRELOAD=/usr/local/cuda/lib64/libnvblas.so /usr/bin/Rscript_ "$@"' \
# > /usr/bin/Rscript && \
# chmod +x /usr/bin/Rscript
#
#echo '#!/usr/bin/with-contenv bash \
# \n## load /etc/environment vars first: \
# \n for line in \$( cat /etc/environment ) ; do export $line ; done \
# \n export LD_PRELOAD=/usr/local/cuda/lib64/libnvblas.so \
# \n exec /usr/lib/rstudio-server/bin/rserver --server-daemonize 0' \
# > /etc/services.d/rstudio/run

View file

@ -0,0 +1,33 @@
#!/bin/bash
set -e
DEFAULT_USER=${1:-${DEFAULT_USER:-"rstudio"}}
if id -u "${DEFAULT_USER}" >/dev/null 2>&1; then
echo "User ${DEFAULT_USER} already exists"
else
## Need to configure non-root user for RStudio
useradd -s /bin/bash -m "$DEFAULT_USER"
echo "${DEFAULT_USER}:${DEFAULT_USER}" | chpasswd
addgroup "${DEFAULT_USER}" staff
## Rocker's default RStudio settings, for better reproducibility
mkdir -p "/home/${DEFAULT_USER}/.rstudio/monitored/user-settings"
cat <<EOF >"/home/${DEFAULT_USER}/.rstudio/monitored/user-settings/user-settings"
alwaysSaveHistory="0"
loadRData="0"
saveAction="0"
EOF
chown -R "${DEFAULT_USER}:${DEFAULT_USER}" "/home/${DEFAULT_USER}"
fi
# If shiny server installed, make the user part of the shiny group
if [ -x "$(command -v shiny-server)" ]; then
adduser "${DEFAULT_USER}" shiny
fi
## configure git not to request password each time
if [ -x "$(command -v git)" ]; then
git config --system credential.helper 'cache --timeout=3600'
git config --system push.default simple
fi

View file

@ -0,0 +1,92 @@
#!/bin/bash
# Batch creation of user accounts in RStudio server. The script reads a list
# of username and password pairs from the `BATCH_USER_CREATION` enviroment
# variable and uses this information to update a group of existing users when
# the container starts. Each pair is of the format: username:password and is
# separated from the next by a semicolon, with no intervening whitespace.
# Usernames may only be up to 32 characters long (required by `useradd`) and
# by default the supplied passwords must be in clear-text (later encrypted by
# `chpasswd`). If an username already exists, the script will deny that
# particular account creation request; if not, the user account will be
# created, the login shell set to Bash and the user's home directory created,
# if it does not exist. By default, a group will be created for each new user
# with the same name as her username. If the groupname already exists, the
# script will deny the group creation request. If the password is not
# specified, it will be assumed that it is equals to the username. All users
# will also be added to the `staff` group (same as rstudio user). A directory
# called .rstudio/monitored/user-settings/user-settings is created in that
# users home directory to store RStudio initial preferences. Users are not
# allowed to read other users' home directory.
set -e
# Remove spaces
remove_spaces() {
local var="$*"
# Remove all spaces
var=${var//$' '/''}
echo -e "$var"
return 0
}
function create_user() {
local username=$1
local password=$2
echo "Processing user '${username}'."
if id -u "$username" >/dev/null 2>&1; then
echo "${username} user already exists. Nothing else to do."
else
useradd -s /bin/bash -m "$username"
# invalid user name
if [ "$?" == 3 ]; then
echo "Failed to create user '${username}'."
return
fi
if [ -z "$password" ]; then
echo "Password not provided. Setting it equals to username."
password=${username}
fi
echo "${username}:${password}" | chpasswd
addgroup "${username}" staff
mkdir -p "/home/${username}/.rstudio/monitored/user-settings"
printf "alwaysSaveHistory='0' \
\nloadRData='0' \
\nsaveAction='0'" \
>"/home/${username}/.rstudio/monitored/user-settings/user-settings"
chown -R "${username}:${username}" "/home/${username}"
# Prevent other users, but the owner, from accessing a home directory
chmod 0700 "/home/${username}"
fi
# If shiny server installed, make the user part of the shiny group
if [ -x "$(command -v shiny-server)" ]; then
adduser "${username}" shiny
fi
echo "Done with user ${username}."
}
if [ -n "$BATCH_USER_CREATION" ]; then
echo "Requested creation of multiple user accounts in batch mode."
BATCH_USER_CREATION=$(remove_spaces "$BATCH_USER_CREATION")
for user in $(echo "$BATCH_USER_CREATION" | tr ';' ' '); do
IFS=: read -r username password <<<"${user}"
if [ -z "$username" ]; then
echo "Failed to create user: username undefined"
continue
else
create_user "$username" "$password" || true
fi
done
echo "Finished creation of multiple user accounts in batch mode."
fi

View file

@ -0,0 +1,10 @@
#!/bin/bash
## not sure why cuda-cudart-dev-10-1 when this is 10.2 and we already have 10.2...
sudo apt update && \
sudo apt install \
libnvinfer-dev \
cuda-cudart-dev-10-1

View file

@ -0,0 +1,63 @@
#!/bin/bash
set -e
UBUNTU_VERSION=${UBUNTU_VERSION:-focal}
CRAN_LINUX_VERSION=${CRAN_LINUX_VERSION:-cran40}
LANG=${LANG:-en_US.UTF-8}
LC_ALL=${LC_ALL:-en_US.UTF-8}
DEBIAN_FRONTEND=noninteractive
# Set up and install R
R_HOME=${R_HOME:-/usr/lib/R}
#R_VERSION=${R_VERSION}
apt-get update
apt-get -y install --no-install-recommends \
ca-certificates \
less \
libopenblas-base \
locales \
vim-tiny \
wget \
dirmngr \
gpg \
gpg-agent
echo "deb http://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_VERSION}-${CRAN_LINUX_VERSION}/" >> /etc/apt/sources.list
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | apt-key add -
# Wildcard * at end of version will grab (latest) patch of requested version
apt-get update && apt-get -y install --no-install-recommends r-base-dev=${R_VERSION}*
rm -rf /var/lib/apt/lists/*
## Add PPAs: NOTE this will mean that installing binary R packages won't be version stable.
##
## These are required at least for bionic-based images since 3.4 r binaries are
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen en_US.utf8
/usr/sbin/update-locale LANG=${LANG}
Rscript -e "install.packages(c('littler', 'docopt'))"
## By default R_LIBS_SITE is unset, and defaults to this, so this is where `littler` will be.
## We set it here for symlinks, but don't make the env var persist (since it's already the default)
R_LIBS_SITE=/usr/local/lib/R/site-library
ln -s ${R_LIBS_SITE}/littler/examples/install.r /usr/local/bin/install.r
ln -s ${R_LIBS_SITE}/littler/examples/install2.r /usr/local/bin/install2.r
ln -s ${R_LIBS_SITE}/littler/examples/installGithub.r /usr/local/bin/installGithub.r
ln -s ${R_LIBS_SITE}/littler/bin/r /usr/local/bin/r

View file

@ -0,0 +1,177 @@
#!/bin/bash
set -e
## Install PROJ, GDAL, GEOS from source.
##
## 'latest' means installing the latest release version.
## build ARGs
NCPUS=${NCPUS:-"-1"}
PROJ_VERSION=${PROJ_VERSION:-"latest"}
GDAL_VERSION=${GDAL_VERSION:-"latest"}
GEOS_VERSION=${GEOS_VERSION:-"latest"}
CRAN=${CRAN_SOURCE:-"https://cloud.r-project.org"}
echo "options(repos = c(CRAN = '${CRAN}'))" >>"${R_HOME}/etc/Rprofile.site"
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
function url_latest_gh_released_asset() {
wget -qO- "https://api.github.com/repos/$1/releases/latest" | grep -oP "(?<=\"browser_download_url\":\s\")https.*\.tar.gz(?=\")"
}
export DEBIAN_FRONTEND=noninteractive
apt_install \
gdb \
git \
libcairo2-dev \
libcurl4-openssl-dev \
libexpat1-dev \
libpq-dev \
libsqlite3-dev \
libudunits2-dev \
make \
pandoc \
qpdf \
sqlite3 \
subversion \
valgrind \
vim \
tk-dev \
wget \
libv8-dev \
libjq-dev \
libprotobuf-dev \
libxml2-dev \
libprotobuf-dev \
protobuf-compiler \
unixodbc-dev \
libssh2-1-dev \
libgit2-dev \
libnetcdf-dev \
locales \
libssl-dev \
libtiff-dev \
cmake \
libtiff5-dev
LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
# install geos
# https://libgeos.org/usage/download/
if [ "$GEOS_VERSION" = "latest" ]; then
GEOS_VERSION=$(wget -qO- "https://api.github.com/repos/libgeos/geos/git/refs/tags" | grep -oP "(?<=\"ref\":\s\"refs/tags/)\d+\.\d+\.\d+" | tail -n -1)
fi
wget http://download.osgeo.org/geos/geos-"${GEOS_VERSION}".tar.bz2
bzip2 -d geos-*bz2
tar xf geos*tar
rm geos*tar
cd geos*
./configure
make
make install
cd ..
ldconfig
# install proj
# https://download.osgeo.org/proj/
if [ "$PROJ_VERSION" = "latest" ]; then
PROJ_DL_URL=$(url_latest_gh_released_asset "OSGeo/PROJ")
else
PROJ_DL_URL="http://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz"
fi
wget "$PROJ_DL_URL" -O proj.tar.gz
tar zxvf proj.tar.gz
rm proj.tar.gz
cd proj-*
mkdir build
cd build
cmake ..
make
make install
cd ../..
ldconfig
# install gdal
# https://download.osgeo.org/gdal/
if [ "$GDAL_VERSION" = "latest" ]; then
GDAL_DL_URL=$(url_latest_gh_released_asset "OSGeo/gdal")
else
GDAL_DL_URL="https://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz"
fi
wget "$GDAL_DL_URL" -O gdal.tar.gz
tar -xf gdal.tar.gz
rm gdal.tar.gz
cd gdal*
./configure
make
make install
cd ..
ldconfig
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
sp \
rgeos \
rgdal \
RPostgreSQL \
RSQLite \
testthat \
knitr \
tidyr \
geosphere \
maptools \
maps \
microbenchmark \
raster \
dplyr \
tibble \
units \
DBI \
covr \
protolite \
tmap \
mapview \
odbc \
pool \
rmarkdown \
RPostgres \
spatstat \
stars
git clone --depth 1 https://github.com/r-spatial/sf.git
git clone --depth 1 https://github.com/r-spatial/lwgeom.git
git clone --depth 1 https://github.com/r-spatial/stars.git
R CMD build lwgeom
R CMD INSTALL lwgeom
rm -rf lwgeom*
R CMD build sf
R CMD INSTALL sf
rm -rf sf*
R CMD build stars
R CMD INSTALL stars
rm -rf stars*
# Clean up
rm -rf /var/lib/apt/lists/*
rm -r /tmp/downloaded_packages
# Check the geospatial packages
echo -e "Check the packages...\n"
R -q -e "library(lwgeom); library(sf); library(stars)"
echo -e "\nInstall packages, done!"

View file

@ -0,0 +1,34 @@
#!/bin/bash
set -e
CRAN=${CRAN_SOURCE:-"https://cloud.r-project.org"}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
# always set this for scripts but don't declare as ENV..
export DEBIAN_FRONTEND=noninteractive
apt_install \
software-properties-common \
gnupg2 \
curl \
ca-certificates
# Adding the ubuntugis-unstable PPA
add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
## in UNSTABLE, we will install everything from source by default:
echo "options(repos = c(CRAN = '${CRAN}'))" >>"${R_HOME}/etc/Rprofile.site"
## install geospatial pakages
/rocker_scripts/install_geospatial.sh
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,11 @@
#!/bin/bash
set -e
python -m venv /opt/venv/rl
. /opt/venv/rl/bin/activate
pip install wheel
pip install gym tensorflow keras keras-rl
chown -R :staff /opt/venv/rl
chmod g+rx /opt/venv/rl

View file

@ -0,0 +1,13 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
## Set our dynamic variables in Renviron.site to be reflected by RStudio Server or Shiny Server
exclude_vars="HOME PASSWORD RSTUDIO_VERSION BATCH_USER_CREATION"
for file in /var/run/s6/container_environment/*; do
sed -i "/^${file##*/}=/d" "${R_HOME}/etc/Renviron.site"
regex="(^| )${file##*/}($| )"
[[ ! $exclude_vars =~ $regex ]] && echo "${file##*/}=$(cat "${file}")" >>"${R_HOME}/etc/Renviron.site" || echo "skipping ${file}"
done
## only file-owner (root) should read container_environment files:
chmod 600 /var/run/s6/container_environment/*

View file

@ -0,0 +1,92 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
## Set defaults for environmental variables in case they are undefined
DEFAULT_USER=${DEFAULT_USER:-rstudio}
USER=${USER:=${DEFAULT_USER}}
USERID=${USERID:=1000}
GROUPID=${GROUPID:=1000}
ROOT=${ROOT:=FALSE}
UMASK=${UMASK:=022}
LANG=${LANG:=en_US.UTF-8}
TZ=${TZ:=Etc/UTC}
if [[ ${DISABLE_AUTH,,} == "true" ]]; then
mv /etc/rstudio/disable_auth_rserver.conf /etc/rstudio/rserver.conf
echo "USER=$USER" >>/etc/environment
fi
if grep --quiet "auth-none=1" /etc/rstudio/rserver.conf; then
echo "Skipping authentication as requested"
elif [ -z "$PASSWORD" ]; then
PASSWORD=$(pwgen 16 1)
printf "\n\n"
tput bold
printf "The password is set to \e[31m%s\e[39m\n" "$PASSWORD"
printf "If you want to set your own password, set the PASSWORD environment variable. e.g. run with:\n"
printf "docker run -e PASSWORD=\e[92m<YOUR_PASS>\e[39m -p 8787:8787 rocker/rstudio\n"
tput sgr0
printf "\n\n"
fi
if [ "$USERID" -lt 1000 ]; then # Probably a macOS user, https://github.com/rocker-org/rocker/issues/205
echo "$USERID is less than 1000"
check_user_id=$(grep -F "auth-minimum-user-id" /etc/rstudio/rserver.conf)
if [[ -n $check_user_id ]]; then
echo "minumum authorised user already exists in /etc/rstudio/rserver.conf: $check_user_id"
else
echo "setting minumum authorised user to 499"
echo auth-minimum-user-id=499 >>/etc/rstudio/rserver.conf
fi
fi
if [ "$USERID" -ne 1000 ]; then ## Configure user with a different USERID if requested.
echo "deleting the default user"
userdel "$DEFAULT_USER"
echo "creating new $USER with UID $USERID"
useradd -m "$USER" -u $USERID
mkdir -p /home/"$USER"
chown -R "$USER" /home/"$USER"
usermod -a -G staff "$USER"
elif [ "$USER" != "$DEFAULT_USER" ]; then
## cannot move home folder when it's a shared volume, have to copy and change permissions instead
cp -r /home/"$DEFAULT_USER" /home/"$USER"
## RENAME the user
usermod -l "$USER" -d /home/"$USER" "$DEFAULT_USER"
groupmod -n "$USER" "$DEFAULT_USER"
usermod -a -G staff "$USER"
chown -R "$USER":"$USER" /home/"$USER"
echo "USER is now $USER"
fi
if [ "$GROUPID" -ne 1000 ]; then ## Configure the primary GID (whether rstudio or $USER) with a different GROUPID if requested.
echo "Modifying primary group $(id "${USER}" -g -n)"
groupmod -g $GROUPID "$(id "${USER}" -g -n)"
echo "Primary group ID is now custom_group $GROUPID"
fi
## Add a password to user
echo "$USER:$PASSWORD" | chpasswd
# Use Env flag to know if user should be added to sudoers
if [[ ${ROOT,,} == "true" ]]; then
adduser "$USER" sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
echo "$USER added to sudoers"
fi
## Change Umask value if desired
if [ "$UMASK" -ne 022 ]; then
echo "server-set-umask=false" >>/etc/rstudio/rserver.conf
echo "Sys.umask(mode=$UMASK)" >>/home/"$USER"/.Rprofile
fi
## Next one for timezone setup
if [ "$TZ" != "Etc/UTC" ]; then
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
fi
## Update Locale if needed
if [ "$LANG" != "en_US.UTF-8" ]; then
/usr/sbin/locale-gen --lang $LANG
/usr/sbin/update-locale --reset LANG=$LANG
fi

View file

@ -0,0 +1,55 @@
#!/bin/bash
set -e
UBUNTU_VERSION=${UBUNTU_VERSION:-focal}
CRAN_LINUX_VERSION=${CRAN_LINUX_VERSION:-cran40}
LANG=${LANG:-en_US.UTF-8}
LC_ALL=${LC_ALL:-en_US.UTF-8}
DEBIAN_FRONTEND=noninteractive
# Set up and install R
R_HOME=${R_HOME:-/usr/lib/R}
#R_VERSION=${R_VERSION}
apt-get update
apt-get -y install --no-install-recommends \
ca-certificates \
less \
libopenblas-base \
locales \
vim-tiny \
wget \
dirmngr \
gpg \
gpg-agent
echo "deb http://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_VERSION}-${CRAN_LINUX_VERSION}/" >> /etc/apt/sources.list
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | apt-key add -
# Wildcard * at end of version will grab (latest) patch of requested version
apt-get update && apt-get -y install --no-install-recommends r-base-dev=${R_VERSION}*
rm -rf /var/lib/apt/lists/*
## Add PPAs: NOTE this will mean that installing binary R packages won't be version stable.
##
## These are required at least for bionic-based images since 3.4 r binaries are
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen en_US.utf8
/usr/sbin/update-locale LANG=${LANG}
Rscript -e "install.packages(c('littler', 'docopt'))"
## By default R_LIBS_SITE is unset, and defaults to this, so this is where `littler` will be.
## We set it here for symlinks, but don't make the env var persist (since it's already the default)
R_LIBS_SITE=/usr/local/lib/R/site-library
ln -s ${R_LIBS_SITE}/littler/examples/install.r /usr/local/bin/install.r
ln -s ${R_LIBS_SITE}/littler/examples/install2.r /usr/local/bin/install2.r
ln -s ${R_LIBS_SITE}/littler/examples/installGithub.r /usr/local/bin/installGithub.r
ln -s ${R_LIBS_SITE}/littler/bin/r /usr/local/bin/r

View file

@ -161,4 +161,4 @@ echo -e "Check the R info...\n"
R -q -e "sessionInfo()"
echo -e "\nInstall R from source, done!"
echo -e "\nInstall R from source, done!"

View file

@ -0,0 +1,56 @@
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:-"-1"}
NB_USER=${NB_USER:-${DEFAULT_USER:-"rstudio"}}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
sudo \
libzmq3-dev
# set up the default user if it does not exist
if ! id -u "${NB_USER}" >/dev/null 2>&1; then
/rocker_scripts/default_user.sh "${NB_USER}"
fi
# install python
/rocker_scripts/install_python.sh
PYTHON_VENV_PATH=${PYTHON_VENV_PATH:-/opt/venv/reticulate}
WORKDIR=${WORKDIR:-/home/${NB_USER}}
# Create a venv dir owned by unprivileged user & set up notebook in it
# This allows non-root to install python libraries if required
mkdir -p "${PYTHON_VENV_PATH}"
chown -R "${NB_USER}" "${PYTHON_VENV_PATH}"
# to use pyenv in a RStudio session, we need to include the PATH in the .profile file
# https://github.com/rocker-org/rocker-versioned2/issues/428
PATH=/opt/pyenv/bin:${PATH}
echo "export PATH=${PATH}" >>"${WORKDIR}/.profile"
cd "${WORKDIR}"
## This gets run as user
sudo -u "${NB_USER}" python3 -m venv "${PYTHON_VENV_PATH}"
python3 -m pip install --no-cache-dir jupyter-rsession-proxy notebook jupyterlab
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" remotes
R --quiet -e "remotes::install_github('IRkernel/IRkernel')"
R --quiet -e "IRkernel::installspec(prefix='${PYTHON_VENV_PATH}')"
# Clean up
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/downloaded_packages

View file

@ -0,0 +1,101 @@
#!/bin/bash
set -e
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
gnupg2 \
curl \
ca-certificates
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" >/etc/apt/sources.list.d/cuda.list
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" >/etc/apt/sources.list.d/nvidia-ml.list
apt-get update
CUDA_VERSION=${CUDA_VERSION:-10.1.243}
CUDA_PKG_VERSION=${CUDA_PKG_VERSION:-10-1=$CUDA_VERSION-1}
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
apt_install \
"cuda-cudart-${CUDA_PKG_VERSION}" \
cuda-compat-10-1
ln -s cuda-10.1 /usr/local/cuda
# Required for nvidia-docker v1
echo "/usr/local/nvidia/lib" >>/etc/ld.so.conf.d/nvidia.conf &&
echo "/usr/local/nvidia/lib64" >>/etc/ld.so.conf.d/nvidia.conf
## PATH & LD_LIBRARY_PATH are wrong?
PATH=${PATH:-/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}}
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-/usr/local/nvidia/lib:/usr/local/nvidia/lib64}
# nvidia-container-runtime
NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-all}
NVIDIA_DRIVER_CAPABILITIES=${NVIDIA_DRIVER_CAPABILITIES:-"compute,utility"}
NVIDIA_REQUIRE_CUDA=${NVIDIA_REQUIRE_CUDA:-"cuda>=10.1 brand=tesla,driver>=384,driver<385 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411"}
## Tensorflow config for cuda runtime.
## Adapted from:
CUDA=10.1
CUDNN=7.6.4.38-1
LIBNVINFER=6.0.1-1
LIBNVINFER_MAJOR_VERSION=6
#SHELL ["/bin/bash", "-c"]
# Pick up some TF dependencies
# There appears to be a regression in libcublas10=10.2.2.89-1 which
# prevents cublas from initializing in TF. See
# https://github.com/tensorflow/tensorflow/issues/9489#issuecomment-562394257
apt_install \
build-essential \
cuda-command-line-tools-10-1 \
libcublas10=10.2.1.243-1 \
cuda-nvrtc-10-1 \
cuda-cufft-10-1 \
cuda-curand-10-1 \
cuda-cusolver-10-1 \
cuda-cusparse-10-1 \
curl \
libcudnn7=${CUDNN}+cuda10.1 \
libfreetype6-dev \
libhdf5-serial-dev \
libzmq3-dev \
pkg-config \
software-properties-common \
unzip
# Install TensorRT if not building for PowerPC
apt_install \
libnvinfer${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA} \
libnvinfer-plugin${LIBNVINFER_MAJOR_VERSION}=${LIBNVINFER}+cuda${CUDA}
apt-get clean
# For CUDA profiling, TensorFlow requires CUPTI.
LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/lib64:$LD_LIBRARY_PATH}
# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
# dynamic linker run-time bindings
ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
echo "/usr/local/cuda/lib64/stubs" >/etc/ld.so.conf.d/z-cuda-stubs.conf
ldconfig
## Add nvtop
#/rocker_scripts/install_nvtop.sh
## Add tensorflow-gpu==1.15 dependencies on the CUDA 10.0 libraries:
/rocker_scripts/install_tf1_cuda_10_0.sh
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,76 @@
#!/bin/bash
set -e
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
gnupg2 \
curl \
ca-certificates
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" >/etc/apt/sources.list.d/cuda.list
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" >/etc/apt/sources.list.d/nvidia-ml.list
apt-get update
CUDA_VERSION=${CUDA_VERSION:-11.1.1}
# For libraries in the cuda-compat-* package: https://docs.nvidia.com/cuda/eula/index.html#attachment-a
apt_install \
cuda-cudart-11-1=11.1.74-1 \
cuda-compat-11-1
ln -s cuda-11.1 /usr/local/cuda
# Required for nvidia-docker v1
echo "/usr/local/nvidia/lib" >>/etc/ld.so.conf.d/nvidia.conf
echo "/usr/local/nvidia/lib64" >>/etc/ld.so.conf.d/nvidia.conf
## Set all of these as global ENV
# PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
# LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64
# NVIDIA_VISIBLE_DEVICES=all
#NVIDIA_DRIVER_CAPABILITIES="compute,utility"
# NVIDIA_REQUIRE_CUDA="cuda>=11.1 brand=tesla,driver>=418,driver<419 brand=tesla,driver>=440,driver<441 brand=tesla,driver>=450,driver<451"
## runtime ####################################################
##FROM ${IMAGE_NAME}:11.1-base-ubuntu20.04
NCCL_VERSION=${NCCL_VERSION:-2.7.8}
apt_install \
cuda-libraries-11-1=11.1.1-1 \
libnpp-11-1=11.1.2.301-1 \
cuda-nvtx-11-1=11.1.74-1 \
libcublas-11-1=11.3.0.106-1 \
"libnccl2=$NCCL_VERSION-1+cuda11.1"
apt-mark hold libnccl2
## devel #######################################################
apt_install \
cuda-nvml-dev-11-1=11.1.74-1 \
cuda-command-line-tools-11-1=11.1.1-1 \
cuda-nvprof-11-1=11.1.105-1 \
libnpp-dev-11-1=11.1.2.301-1 \
cuda-libraries-dev-11-1=11.1.1-1 \
cuda-minimal-build-11-1=11.1.1-1 \
libnccl-dev=2.7.8-1+cuda11.1 \
libcublas-dev-11-1=11.3.0.106-1 \
libcusparse-11-1=11.3.0.10-1 \
libcusparse-dev-11-1=11.3.0.10-1
apt-mark hold libnccl-dev
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,86 @@
#!/bin/bash
set -e
# always set this for scripts but don't declare as ENV..
export DEBIAN_FRONTEND=noninteractive
## build ARGs
NCPUS=${NCPUS:--1}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
gdal-bin \
lbzip2 \
libfftw3-dev \
libgdal-dev \
libgeos-dev \
libgsl0-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libhdf4-alt-dev \
libhdf5-dev \
libjq-dev \
libpq-dev \
libproj-dev \
libprotobuf-dev \
libnetcdf-dev \
libsqlite3-dev \
libssl-dev \
libudunits2-dev \
lsb-release \
netcdf-bin \
postgis \
protobuf-compiler \
sqlite3 \
tk-dev \
unixodbc-dev
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
RColorBrewer \
RandomFields \
RNetCDF \
classInt \
deldir \
gstat \
hdf5r \
lidR \
mapdata \
maptools \
mapview \
ncdf4 \
proj4 \
raster \
rgdal \
rgeos \
rlas \
sf \
sp \
spacetime \
spatstat \
spatialreg \
spdep \
stars \
terra \
tidync \
tmap \
geoR \
geosphere \
BiocManager
R -e "BiocManager::install('rhdf5')"
## install wgrib2 for NOAA's NOMADS / rNOMADS forecast files
/rocker_scripts/install_wgrib2.sh
# Clean up
rm -rf /var/lib/apt/lists/*
rm -r /tmp/downloaded_packages

View file

@ -0,0 +1,58 @@
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:--1}
JULIA_VERSION=${1:-${JULIA_VERSION:-latest}}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
ARCH_LONG=$(uname -p)
ARCH_SHORT=$ARCH_LONG
if [ "$ARCH_LONG" = "x86_64" ]; then
ARCH_SHORT="x64"
fi
apt_install wget
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
yaml \
JuliaCall \
JuliaConnectoR
# Get the latest Julia version by using R and the R yaml package.
if [ "$JULIA_VERSION" = "latest" ]; then
# shellcheck disable=SC2016
JULIA_VERSION=$(Rscript -e '
js <- yaml::read_yaml("https://julialang-s3.julialang.org/bin/versions.json")
versions <- names(js)
is_stable <- unlist(Map(function(x) x$stable, js))
latest_version <- sort(versions[is_stable], decreasing = TRUE)[1]
cat(latest_version)
')
fi
JULIA_MINOR_VERSION=${JULIA_VERSION%.*}
# Download Julia and create a symbolic link.
wget "https://julialang-s3.julialang.org/bin/linux/${ARCH_SHORT}/${JULIA_MINOR_VERSION}/julia-${JULIA_VERSION}-linux-${ARCH_LONG}.tar.gz"
mkdir /opt/julia
tar zxvf "julia-${JULIA_VERSION}-linux-${ARCH_LONG}.tar.gz" -C /opt/julia --strip-components 1
rm -f "julia-${JULIA_VERSION}-linux-${ARCH_LONG}.tar.gz"
ln -s /opt/julia/bin/julia /usr/local/bin/julia
julia --version
# Clean up
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/downloaded_packages

View file

@ -0,0 +1,12 @@
#!/bin/bash
set -e
apt-get update && apt-get -y install cmake libncurses5-dev libncursesw5-dev git
git clone https://github.com/Syllo/nvtop.git
mkdir -p nvtop/build && cd nvtop/build
cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True
make
make install
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,90 @@
#!/bin/bash
## Install pandoc or symlinks pandoc, pandoc-citeproc so they are available system-wide.
##
## In order of preference, first argument of the script, the PANDOC_VERSION variable.
## ex. latest, default
##
## 'default' means the version bundled with RStudio if RStudio is installed, but 'latest' otherwise.
## 'latest' means installing the latest release version.
set -e
PANDOC_VERSION=${1:-${PANDOC_VERSION:-"default"}}
ARCH=$(dpkg --print-architecture)
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install wget
if [ -x "$(command -v pandoc)" ]; then
INSTALLED_PANDOC_VERSION=$(pandoc --version 2>/dev/null | head -n 1 | grep -oP '[\d\.]+$')
fi
if [ -f "/usr/lib/rstudio-server/bin/pandoc/pandoc" ]; then
BUNDLED_PANDOC="/usr/lib/rstudio-server/bin/pandoc/pandoc"
elif [ -f "/usr/lib/rstudio-server/bin/quarto/bin/pandoc" ]; then
BUNDLED_PANDOC="/usr/lib/rstudio-server/bin/quarto/bin/pandoc"
elif [ -f "/usr/lib/rstudio-server/bin/quarto/bin/tools/pandoc" ]; then
BUNDLED_PANDOC="/usr/lib/rstudio-server/bin/quarto/bin/tools/pandoc"
fi
if [ -n "$BUNDLED_PANDOC" ]; then
BUNDLED_PANDOC_VERSION="$($BUNDLED_PANDOC --version | head -n 1 | grep -oP '[\d\.]+$')"
fi
if [ "$PANDOC_VERSION" != "$INSTALLED_PANDOC_VERSION" ]; then
if [ "$PANDOC_VERSION" = "default" ] && [ -z "$BUNDLED_PANDOC" ]; then
PANDOC_VERSION="latest"
fi
if [ "$PANDOC_VERSION" = "$BUNDLED_PANDOC_VERSION" ] || [ "$PANDOC_VERSION" = "default" ]; then
ln -fs "$BUNDLED_PANDOC" /usr/local/bin
if [ -f "${BUNDLED_PANDOC}-citeproc" ]; then
ln -fs "${BUNDLED_PANDOC}-citeproc" /usr/local/bin
fi
else
if [ -L "/usr/local/bin/pandoc" ]; then
unlink /usr/local/bin/pandoc
fi
if [ -L "/usr/local/bin/pandoc-citeproc" ]; then
unlink /usr/local/bin/pandoc-citeproc
fi
if [ "$PANDOC_VERSION" = "latest" ]; then
PANDOC_DL_URL=$(wget -qO- https://api.github.com/repos/jgm/pandoc/releases/latest | grep -oP "(?<=\"browser_download_url\":\s\")https.*${ARCH}\.deb")
else
PANDOC_DL_URL="https://github.com/jgm/pandoc/releases/download/${PANDOC_VERSION}/pandoc-${PANDOC_VERSION}-1-${ARCH}.deb"
fi
wget "$PANDOC_DL_URL" -O pandoc.deb
dpkg -i pandoc.deb
rm pandoc.deb
fi
## Symlink pandoc & standard pandoc templates for use system-wide
PANDOC_TEMPLATES_VERSION=$(pandoc -v | grep -oP "(?<=pandoc\s)[0-9\.]+$")
wget "https://github.com/jgm/pandoc-templates/archive/${PANDOC_TEMPLATES_VERSION}.tar.gz" -O pandoc-templates.tar.gz
rm -fr /opt/pandoc/templates
mkdir -p /opt/pandoc/templates
tar xvf pandoc-templates.tar.gz
cp -r pandoc-templates*/* /opt/pandoc/templates && rm -rf pandoc-templates*
rm -fr /root/.pandoc
mkdir /root/.pandoc && ln -s /opt/pandoc/templates /root/.pandoc/templates
fi
# Clean up
rm -rf /var/lib/apt/lists/*
# Check the pandoc version
echo -e "Check the pandoc version...\n"
pandoc --version
echo -e "\nInstall pandoc, done!"

View file

@ -0,0 +1,44 @@
#!/bin/bash
## Install pyenv, to facilitate installation of different python versions
## Allows users to do things like:
## pyenv install 3.7.9 # install python 3.7.9; e.g. for tensorflow 1.15.x
## pyenv global 3.7.9 # activate as the default python
##
set -e
PYTHON_CONFIGURE_OPTS=${PYTHON_CONFIGURE_OPTS:-"--enable-shared"}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
echo "PYTHON_CONFIGURE_OPTS=${PYTHON_CONFIGURE_OPTS}" >>"${R_HOME}/etc/R_environ"
apt_install \
curl \
python3-pip
python3 -m pip --no-cache-dir install --upgrade --ignore-installed pipenv
# consider a version-stable alternative for the installer?
curl https://pyenv.run | bash
mv /root/.pyenv /opt/pyenv
# pipenv requires ~/.local/bin to be on the path...
echo "PATH=/opt/pyenv/bin:~/.local/bin:$PATH" >>"${R_HOME}/etc/Renviron.site"
cat <<"EOF" >>/etc/bash.bashrc
PATH=/opt/pyenv/bin:~/.local/bin:$PATH
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
EOF
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,77 @@
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:--1}
WORKON_HOME=${WORKON_HOME:-/opt/venv}
PYTHON_VENV_PATH=${PYTHON_VENV_PATH:-${WORKON_HOME}/reticulate}
RETICULATE_MINICONDA_ENABLED=${RETICULATE_MINICONDA_ENABLED:-FALSE}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
git \
libpng-dev \
libpython3-dev \
python3-dev \
python3-pip \
python3-virtualenv \
python3-venv \
swig
python3 -m pip --no-cache-dir install --upgrade \
pip \
setuptools \
virtualenv
# Some TF tools expect a "python" binary
if [ ! -e /usr/local/bin/python ]; then
ln -s "$(which python3)" /usr/local/bin/python
fi
mkdir -p "${WORKON_HOME}"
python3 -m venv "${PYTHON_VENV_PATH}"
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" reticulate
## Ensure RStudio inherits this env var
cat <<EOF >>"${R_HOME}/etc/Renviron.site"
WORKON_HOME=${WORKON_HOME}
RETICULATE_MINICONDA_ENABLED=${RETICULATE_MINICONDA_ENABLED}
EOF
## symlink these so that these are available when switching to a new venv
## -f check for file, -L for link, -e for either
if [ ! -e /usr/local/bin/python ]; then
ln -s "$(which python3)" /usr/local/bin/python
fi
if [ ! -e /usr/local/bin/pip ]; then
ln -s "${PYTHON_VENV_PATH}/bin/pip" /usr/local/bin/pip
fi
if [ ! -e /usr/local/bin/virtualenv ]; then
ln -s "${PYTHON_VENV_PATH}/bin/virtualenv" /usr/local/bin/virtualenv
fi
## Allow staff-level users to modify the shared environment
chown -R :staff "${WORKON_HOME}"
chmod g+wx "${WORKON_HOME}"
chown :staff "${PYTHON_VENV_PATH}"
## Enable pyenv
/rocker_scripts/install_pyenv.sh
# Clean up
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/downloaded_packages

View file

@ -0,0 +1,77 @@
#!/bin/bash
## Install quarto cli or symlink quarto cli so they are available system-wide.
##
## In order of preference, first argument of the script, the QUARTO_VERSION variable.
## ex. latest, default, 0.9.16
##
## 'default' means the version bundled with RStudio if RStudio is installed, but 'latest' otherwise.
## 'latest' means installing the latest release version.
set -e
## build ARGs
NCPUS=${NCPUS:--1}
QUARTO_VERSION=${1:-${QUARTO_VERSION:-"latest"}}
# Only amd64 build can be installed now
ARCH=$(dpkg --print-architecture)
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install wget
if [ -x "$(command -v quarto)" ]; then
INSTALLED_QUARTO_VERSION=$(quarto --version)
fi
# Check RStudio bundled quarto cli
if [ -f "/usr/lib/rstudio-server/bin/quarto/bin/quarto" ]; then
BUNDLED_QUARTO="/usr/lib/rstudio-server/bin/quarto/bin/quarto"
fi
if [ -n "$BUNDLED_QUARTO" ]; then
BUNDLED_QUARTO_VERSION="$($BUNDLED_QUARTO --version)"
fi
# Install quarto cli
if [ "$QUARTO_VERSION" != "$INSTALLED_QUARTO_VERSION" ]; then
# Check RStudio bundled quarto cli
if [ "$QUARTO_VERSION" = "default" ] && [ -z "$BUNDLED_QUARTO" ]; then
QUARTO_VERSION="latest"
fi
if [ "$QUARTO_VERSION" = "$BUNDLED_QUARTO_VERSION" ] || [ "$QUARTO_VERSION" = "default" ]; then
ln -fs "$BUNDLED_QUARTO" /usr/local/bin
else
if [ "$QUARTO_VERSION" = "latest" ]; then
QUARTO_DL_URL=$(wget -qO- https://api.github.com/repos/quarto-dev/quarto-cli/releases/latest | grep -oP "(?<=\"browser_download_url\":\s\")https.*${ARCH}\.deb")
else
QUARTO_DL_URL="https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-${ARCH}.deb"
fi
wget "$QUARTO_DL_URL" -O quarto.deb
dpkg -i quarto.deb
rm quarto.deb
fi
quarto check install
fi
# Install the quarto R package
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
knitr \
quarto
# Clean up
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/downloaded_packages

View file

@ -118,6 +118,7 @@ EOF
/rocker_scripts/default_user.sh "${DEFAULT_USER}"
# install user config initiation script
mkdir -p /etc/cont-init.d
cp /rocker_scripts/init_set_env.sh /etc/cont-init.d/01_set_env
cp /rocker_scripts/init_userconf.sh /etc/cont-init.d/02_userconf
cp /rocker_scripts/pam-helper.sh /usr/lib/rstudio-server/bin/pam-helper
@ -130,4 +131,4 @@ echo -e "Check the RStudio Server version...\n"
/usr/lib/rstudio-server/bin/rstudio-server version
echo -e "\nInstall RStudio Server, done!"
echo -e "\nInstall RStudio Server, done!"

View file

@ -0,0 +1,43 @@
#!/bin/bash
set -e
### Sets up S6 supervisor.
S6_VERSION=${1:-${S6_VERSION:-"v2.1.0.2"}}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
ARCH=$(dpkg --print-architecture)
if [ "$ARCH" = "arm64" ]; then
ARCH=aarch64
fi
DOWNLOAD_FILE=s6-overlay-${ARCH}.tar.gz
apt_install wget
## Set up S6 init system
if [ -f "/rocker_scripts/.s6_version" ] && [ "$S6_VERSION" = "$(cat /rocker_scripts/.s6_version)" ]; then
echo "S6 already installed"
else
wget -P /tmp/ "https://github.com/just-containers/s6-overlay/releases/download/${S6_VERSION}/${DOWNLOAD_FILE}"
## need the modified double tar now, see https://github.com/just-containers/s6-overlay/issues/288
tar hzxf /tmp/$DOWNLOAD_FILE -C / --exclude=usr/bin/execlineb
tar hzxf /tmp/$DOWNLOAD_FILE -C /usr ./bin/execlineb
echo "$S6_VERSION" >/rocker_scripts/.s6_version
fi
# Clean up
rm -rf /var/lib/apt/lists/*
rm -f /tmp/$DOWNLOAD_FILE

View file

@ -0,0 +1,74 @@
#!/bin/bash
set -e
SHINY_SERVER_VERSION=${1:-${SHINY_SERVER_VERSION:-latest}}
## build ARGs
NCPUS=${NCPUS:--1}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
sudo \
gdebi-core \
libcurl4-openssl-dev \
libcairo2-dev \
libxt-dev \
xtail \
wget
# Run dependency scripts
/rocker_scripts/install_s6init.sh
/rocker_scripts/install_pandoc.sh
# Install Shiny server
if [ "$SHINY_SERVER_VERSION" = "latest" ]; then
SHINY_SERVER_VERSION=$(wget -qO- https://download3.rstudio.org/ubuntu-14.04/x86_64/VERSION)
fi
wget --no-verbose "https://download3.rstudio.org/ubuntu-14.04/x86_64/shiny-server-${SHINY_SERVER_VERSION}-amd64.deb" -O ss-latest.deb
gdebi -n ss-latest.deb
rm ss-latest.deb
# Get R packages
install2.r --error --skipinstalled -n "$NCPUS" shiny rmarkdown
# Set up directories and permissions
if [ -x "$(command -v rstudio-server)" ]; then
DEFAULT_USER=${DEFAULT_USER:-rstudio}
adduser "${DEFAULT_USER}" shiny
fi
cp -R /usr/local/lib/R/site-library/shiny/examples/* /srv/shiny-server/
chown shiny:shiny /var/lib/shiny-server
mkdir -p /var/log/shiny-server
chown shiny:shiny /var/log/shiny-server
# create init scripts
mkdir -p /etc/services.d/shiny-server
cat <<"EOF" >/etc/services.d/shiny-server/run
#!/usr/bin/with-contenv bash
## load /etc/environment vars first:
for line in $( cat /etc/environment ) ; do export $line > /dev/null; done
if [ "$APPLICATION_LOGS_TO_STDOUT" != "false" ]; then
exec xtail /var/log/shiny-server/ &
fi
exec shiny-server 2>&1
EOF
chmod +x /etc/services.d/shiny-server/run
# install init script
cp /rocker_scripts/init_set_env.sh /etc/cont-init.d/01_set_env
# Clean up
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/downloaded_packages

View file

@ -0,0 +1,23 @@
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:--1}
TENSORFLOW_VERSION=${1:-${TENSORFLOW_VERSION:-default}}
KERAS_VERSION=${2:-${KERAS_VERSION:-default}}
## Install python dependency
# . /rocker_scripts/install_python.sh
## To support different version of TF, install to different virtualenvs
TENSORFLOW_VENV=$PYTHON_VENV_PATH
install2.r --error --skipinstalled -n $NCPUS keras
#Rscript -e "keras::install_keras(version = \"$KERAS_VERSION\", \
# tensorflow = \"$TENSORFLOW_VERSION\", \
# envname =\"$TENSORFLOW_VENV\")"
rm -r /tmp/downloaded_packages
chown -R 1000:1000 /opt/venv
chmod -R 777 /opt/venv

View file

@ -0,0 +1,72 @@
#!/bin/bash
set -e
CTAN_REPO=${1:-${CTAN_REPO:-"https://mirror.ctan.org/systems/texlive/tlnet"}}
ARCH=$(uname -m)
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
cat <<EOF >/tmp/texlive-profile.txt
selected_scheme scheme-infraonly
TEXDIR /usr/local/texlive
TEXMFCONFIG /opt/texlive/texmf-config
TEXMFHOME /opt/texlive/texmf
TEXMFLOCAL /opt/texlive/texmf-local
TEXMFSYSCONFIG /opt/texlive/texmf-config
TEXMFSYSVAR /opt/texlive/texmf-var
TEXMFVAR /opt/texlive/texmf-var
option_doc 0
option_src 0
EOF
export PATH="${PATH}:/usr/local/texlive/bin/${ARCH}-linux/"
mkdir -p /opt/texlive
# set up packages
apt_install \
wget \
perl \
xzdec
wget "${CTAN_REPO}/install-tl-unx.tar.gz"
tar -xzf install-tl-unx.tar.gz
cd ./install-tl-20*
./install-tl --profile=/tmp/texlive-profile.txt --repository "$CTAN_REPO"
cd ..
rm -rf install-tl-*
rm /tmp/texlive-profile.txt
tlmgr update --self
tlmgr install latex-bin luatex xetex
tlmgr install ae bibtex context inconsolata listings makeindex metafont mfware parskip pdfcrop tex tools url xkeyval
## do not add to /usr/local/bin
# tlmgr path add
# instead, we keep binaries separate and add to PATH
echo "PATH=${PATH}" >>"${R_HOME}"/etc/Renviron.site
## open permissions to avoid needless warnings
NON_ROOT_USER=$(getent passwd "1000" | cut -d: -f1)
if [ -n "$NON_ROOT_USER" ]; then
chown -R "${NON_ROOT_USER}":staff /opt/texlive
chown -R "${NON_ROOT_USER}":staff /usr/local/texlive
fi
chmod -R 777 /opt/texlive
chmod -R 777 /usr/local/texlive
# Clean up
rm -rf /var/lib/apt/lists/*
# Check the tlmgr version
echo -e "Check the tlmgr version...\n"
tlmgr --version
echo -e "\nInstall texlive, done!"

View file

@ -0,0 +1,29 @@
#!/bin/bash
set -e
# Tensorflow 1.x is required for numerous projects.
# Even the most recent of the 1.x, 1.15.5 is compatible only
# with CUDA 10.0 versions of the following libraries.
# Fortunately, these are available from the NVIDIA Ubuntu debian PPA repos added in 10.1 images
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
cuda-cudart-10-0 \
cuda-cufft-10-0 \
cuda-cusolver-10-0 \
cuda-curand-10-0 \
cuda-cusparse-10-0 \
cuda-cublas-10-0
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,65 @@
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:--1}
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
libxml2-dev \
libcairo2-dev \
libgit2-dev \
default-libmysqlclient-dev \
libpq-dev \
libsasl2-dev \
libsqlite3-dev \
libssh2-1-dev \
libxtst6 \
libcurl4-openssl-dev \
unixodbc-dev
install2.r --error --skipinstalled -n "$NCPUS" \
tidyverse \
devtools \
rmarkdown \
BiocManager \
vroom \
gert
## dplyr database backends
install2.r --error --skipmissing --skipinstalled -n "$NCPUS" \
arrow \
dbplyr \
DBI \
dtplyr \
duckdb \
nycflights13 \
Lahman \
RMariaDB \
RPostgres \
RSQLite \
fst
## a bridge to far? -- brings in another 60 packages
# install2.r --error --skipinstalled -n "$NCPUS" tidymodels
# Clean up
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/downloaded_packages
# Check the tidyverse core packages' version
echo -e "Check the tidyverse package...\n"
R -q -e "library(tidyverse)"
echo -e "\nInstall tidyverse package, done!"

View file

@ -0,0 +1,95 @@
#!/bin/bash
set -e
## build ARGs
NCPUS=${NCPUS:--1}
# always set this for scripts but don't declare as ENV..
export DEBIAN_FRONTEND=noninteractive
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install \
cmake \
curl \
default-jdk \
fonts-roboto \
ghostscript \
hugo \
less \
libbz2-dev \
libglpk-dev \
libgmp3-dev \
libfribidi-dev \
libharfbuzz-dev \
libhunspell-dev \
libicu-dev \
liblzma-dev \
libmagick++-dev \
libopenmpi-dev \
libpcre2-dev \
libssl-dev \
libv8-dev \
libxml2-dev \
libxslt1-dev \
libzmq3-dev \
lsb-release \
qpdf \
texinfo \
software-properties-common \
vim \
wget
# libgit2-dev also depends on the libcurl4-gnutils in bionic but not on focal
# cran PPA is a super-stable solution to this
UBUNTU_VERSION=$(lsb_release -sc)
if [ "${UBUNTU_VERSION}" == "bionic" ]; then
add-apt-repository -y ppa:cran/travis
fi
# librdf0-dev depends on libcurl4-gnutils-dev instead of libcurl4-openssl-dev...
# So: we can build the redland package bindings and then swap back to libcurl-openssl-dev... (ick)
# explicitly install runtime library sub-deps of librdf0-dev so they are not auto-removed.
apt_install librdf0-dev
install2.r --error --skipinstalled -n "$NCPUS" redland
apt_install \
libcurl4-openssl-dev \
libgit2-dev \
libxslt-dev \
librdf0 \
redland-utils \
rasqal-utils \
raptor2-utils
apt-get remove -y systemd
apt-get -y autoremove
## Add LaTeX, rticles and bookdown support
wget "https://travis-bin.yihui.name/texlive-local.deb"
dpkg -i texlive-local.deb
rm texlive-local.deb
## Install texlive
/rocker_scripts/install_texlive.sh
install2.r --error --skipinstalled -n "$NCPUS" tinytex
install2.r --error --skipmissing --deps TRUE --skipinstalled -n "$NCPUS" \
blogdown \
bookdown \
distill \
rticles \
rmdshower \
rJava \
xaringan
# Clean up
rm -rf /tmp/downloaded_packages
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,38 @@
#!/bin/bash
set -e
## https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
# a function to install apt packages only if they are not installed
function apt_install() {
if ! dpkg -s "$@" >/dev/null 2>&1; then
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
apt-get update
fi
apt-get install -y --no-install-recommends "$@"
fi
}
apt_install wget
cd /opt
wget https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz
tar -xvf wgrib2.tgz
rm -rf wgrib2.tgz
cd grib2
## arm64: need to rewrite the makefile to compile wgrib2 to use NetCDF4, but it is not supported in 8/2020.
## https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/index.html
## set USE_NETCDF4=1, USE_JASPER=0
# if [ $(dpkg --print-architecture) = "arm64" ]; then
# sed -i -e 's/^USE_NETCDF4=0/USE_NETCDF4=1/' makefile
# sed -i -e 's/^USE_NETCDF3=1/USE_NETCDF3=0/' makefile
# sed -i -e 's/^USE_JASPER=1/USE_JASPER=0/' makefile
# fi
## really someone needs to learn proper packaging conventions, but whatever
CC=gcc FC=gfortran make
ln -s /opt/grib2/wgrib2/wgrib2 /usr/local/bin/wgrib2
# Clean up
rm -rf /var/lib/apt/lists/*

View file

@ -0,0 +1,10 @@
#!/bin/bash
set -o nounset
## Enforces the custom password specified in the PASSWORD environment variable
## The accepted RStudio username is the same as the USER environment variable (i.e., local user name).
IFS='' read -r password
[ "${USER}" = "${1}" ] && [ "${PASSWORD}" = "${password}" ]

View file

@ -0,0 +1,13 @@
#!/bin/bash
R_DOC_DIR=$R_HOME/doc
R_INCLUDE_DIR=$R_HOME/include
R_SHARE_DIR=$R_HOME/share
RSTUDIO_DEFAULT_R_VERSION_HOME=$R_HOME
RSTUDIO_DEFAULT_R_VERSION=$R_VERSION
PATH=$PATH:/usr/lib/rstudio-server/bin
rsession --standalone=1 \
--program-mode=server \
--session-timeout-minutes=0 \
--user-identity=rstudio \
--www-port=8787

View file

@ -89,10 +89,10 @@ rm -rf /var/lib/apt/lists/*
# Check the R info
echo -e "Check the littler info...\n"
r --version
R --version
echo -e "Check the R info...\n"
R -q -e "sessionInfo()"
echo -e "Setup R, done!"
echo -e "Setup R, done!"

View file

@ -0,0 +1,36 @@
## Tensorflow:
install.packages('keras', repos='http://cran.us.r-project.org')
library(keras)
mnist <- dataset_mnist()
x_train <- mnist$train$x
y_train <- mnist$train$y
x_test <- mnist$test$x
y_test <- mnist$test$y
# reshape
x_train <- array_reshape(x_train, c(nrow(x_train), 784))
x_test <- array_reshape(x_test, c(nrow(x_test), 784))
# rescale
x_train <- x_train / 255
x_test <- x_test / 255
y_train <- to_categorical(y_train, 10)
y_test <- to_categorical(y_test, 10)
model <- keras_model_sequential()
model %>%
layer_dense(units = 256, activation = 'relu', input_shape = c(784)) %>%
layer_dropout(rate = 0.4) %>%
layer_dense(units = 128, activation = 'relu') %>%
layer_dropout(rate = 0.3) %>%
layer_dense(units = 10, activation = 'softmax')
model %>% compile(
loss = 'categorical_crossentropy',
optimizer = optimizer_rmsprop(),
metrics = c('accuracy')
)
history <- model %>% fit(
x_train, y_train,
epochs = 30, batch_size = 128,
validation_split = 0.2
)
model %>% evaluate(x_test, y_test)

View file

@ -0,0 +1,11 @@
install.packages("callr")
callr::r(function(){
system.time({
N <- 2^14
M <- matrix(rnorm(N*N), nrow=N, ncol=N)
M %*% M
})
}, env = c(LD_PRELOAD="libnvblas.so")
)