diff --git a/workspaces/ansible-terraform-workspace/Dockerfile b/workspaces/ansible-terraform-workspace/Dockerfile index c0f324a..9c1fd09 100644 --- a/workspaces/ansible-terraform-workspace/Dockerfile +++ b/workspaces/ansible-terraform-workspace/Dockerfile @@ -1,5 +1,5 @@ ARG docker_registry=docker.io/alnoda -ARG image_tag=18.04-0.7 +ARG image_tag=18.04-0.11 ## Images used: ARG BUILD_IMAGE=node:12.18.3 @@ -63,10 +63,12 @@ COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml COPY ./mkdocs/home.md /home/docs/docs/pages/home COPY ./mkdocs/Ara.png /home/docs/docs/pages/home/home/ COPY ./mkdocs/Blast-radius.png /home/docs/docs/pages/home/home/ +COPY ./mkdocs/Terraform-Rover.png /home/docs/docs/pages/home/home/ COPY ./mkdocs/helpers.py /home/docs/macros COPY README.md /home/docs/docs/docs.md -RUN echo "------------------------------------------------------ ansible ara" \ +RUN apt-get -y update \ + && echo "------------------------------------------------------ ansible ara" \ && echo "UTC" > /etc/timezone \ && mkdir -p /home/abc/.ara/server \ && ara-manage makemigrations \ @@ -79,7 +81,6 @@ RUN echo "------------------------------------------------------ ansible ara" \ && rm /tmp/terraform_0.14.6_linux_amd64.zip \ && echo "------------------------------------------------------ blast-radius" \ && apt-get install -y graphviz \ - && mkdir -p /home/terraform \ && echo "------------------------------------------------------ terraform-docs" \ && cd /tmp && curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.15.0/terraform-docs-v0.15.0-linux-amd64.tar.gz \ && tar -xzf terraform-docs.tar.gz \ @@ -134,6 +135,8 @@ RUN echo "------------------------------------------------------ ansible ara" \ && find /home -type d | xargs -I{} chown -R abc {} \ && find /home -type f | xargs -I{} chown abc {} +ENV TERRAFORM_ROVER="http://localhost:9000" + USER abc diff --git a/workspaces/ansible-terraform-workspace/mkdocs/Terraform-Rover.png b/workspaces/ansible-terraform-workspace/mkdocs/Terraform-Rover.png new file mode 100644 index 0000000..53097c6 Binary files /dev/null and b/workspaces/ansible-terraform-workspace/mkdocs/Terraform-Rover.png differ diff --git a/workspaces/ansible-terraform-workspace/mkdocs/helpers.py b/workspaces/ansible-terraform-workspace/mkdocs/helpers.py index e6ef8ce..7007752 100644 --- a/workspaces/ansible-terraform-workspace/mkdocs/helpers.py +++ b/workspaces/ansible-terraform-workspace/mkdocs/helpers.py @@ -14,7 +14,8 @@ port_increments = { "TERMINAL_URL": 6, "MC_URL": 7, "HTOP_URL": 8, - "ANSIBLE_ARA": 9 + "ANSIBLE_ARA": 9, + "BLAST_RADIUS": 10 } # this function name should not be changed @@ -29,7 +30,7 @@ def define_env(env): @env.macro def get_tool_url(env): try: - return os.environ[name] + return os.environ[env] except: # Get host host = "localhost" diff --git a/workspaces/ansible-terraform-workspace/mkdocs/home.md b/workspaces/ansible-terraform-workspace/mkdocs/home.md index ed71692..799fdc9 100644 --- a/workspaces/ansible-terraform-workspace/mkdocs/home.md +++ b/workspaces/ansible-terraform-workspace/mkdocs/home.md @@ -72,6 +72,24 @@ "image": "Filebrowser.png", "description": "Browse, upload and download files and folders to and from the Workspace" }, + { + "env": "ANSIBLE_ARA", + "name": "Ansible Ara", + "image": "Ara.png", + "description": "Monitor for all Ansible plays" + }, + { + "env": "TERRAFORM_ROVER", + "name": "Terraform Rover", + "image": "Terraform-Rover.png", + "description": "Not started! Start manually with your Terraform project dir, i.e. cd /home/examples/terraform-scaleway/; terraform init; rover --workingDir /home/examples/terraform-scaleway/" + }, + { + "env": "BLAST_RADIUS", + "name": "Blast Radius", + "image": "Blast-radius.png", + "description": "Not started! Start manually with your Terraform project dir, i.e. cd /home/examples/terraform-scaleway; terraform init; blast-radius --serve --port 8030" + }, { "env": "CRONICLE_URL", "name": "Cronicle", @@ -101,12 +119,6 @@ "name": "Process monitor", "image": "Htop.jpg", "description": "Monitor running process and resource utilization" - }, - { - "env": "ANSIBLE_ARA", - "name": "Ansible Ara", - "image": "Ara.png", - "description": "Monitor for all Ansible plays" } ] %} diff --git a/workspaces/codeserver-workspace/mkdocs/helpers.py b/workspaces/codeserver-workspace/mkdocs/helpers.py index f41c074..11e499b 100644 --- a/workspaces/codeserver-workspace/mkdocs/helpers.py +++ b/workspaces/codeserver-workspace/mkdocs/helpers.py @@ -28,7 +28,7 @@ def define_env(env): @env.macro def get_tool_url(env): try: - return os.environ[name] + return os.environ[env] except: # Get host host = "localhost" diff --git a/workspaces/kafka-workspace/mkdocs/macros/helpers.py b/workspaces/kafka-workspace/mkdocs/macros/helpers.py index f41c074..11e499b 100644 --- a/workspaces/kafka-workspace/mkdocs/macros/helpers.py +++ b/workspaces/kafka-workspace/mkdocs/macros/helpers.py @@ -28,7 +28,7 @@ def define_env(env): @env.macro def get_tool_url(env): try: - return os.environ[name] + return os.environ[env] except: # Get host host = "localhost" diff --git a/workspaces/mkdocs-magicspace/Dockerfile b/workspaces/mkdocs-magicspace/Dockerfile index 29bf90a..57cab47 100644 --- a/workspaces/mkdocs-magicspace/Dockerfile +++ b/workspaces/mkdocs-magicspace/Dockerfile @@ -1,5 +1,5 @@ ARG docker_registry=docker.io/alnoda -ARG image_tag=18.04-0.5 +ARG image_tag=18.04-0.11 FROM ${docker_registry}/workspace-in-docker:${image_tag} @@ -14,6 +14,10 @@ COPY mkdocs-requirements.txt /home/abc/installed-python-packages COPY ./mkdocs/IDE.jpg /home/docs/docs/pages/home/home/ COPY ./mkdocs/showcase.md /home/docs/docs/showcase.md COPY ./mkdocs/mkdocs.yml /home/docs/mkdocs.yml +COPY ./mkdocs/home.md /home/docs/docs/pages/home +COPY ./mkdocs/helpers.py /home/docs/macros +COPY ./mkdocs/Magicspace-web.png /home/docs/docs/pages/home/home/ +COPY ./examples/ /home/examples/ RUN apt-get -y update \ && echo "-------------------------------------------- weasyprint" \ @@ -26,6 +30,7 @@ RUN apt-get -y update \ && mv /tmp/alnoda-workspaces/utils /home/abc/ \ && rm -rf /tmp/alnoda-workspaces \ && echo "------------------------------------------------------ user" \ + && chown -R abc /home/examples \ && chown -R abc /home/abc/utils \ && chown -R abc /home/abc/installed-python-packages diff --git a/workspaces/mkdocs-magicspace/examples/mkdocs-material/docs/index.md b/workspaces/mkdocs-magicspace/examples/mkdocs-material/docs/index.md new file mode 100644 index 0000000..ec6f6bf --- /dev/null +++ b/workspaces/mkdocs-magicspace/examples/mkdocs-material/docs/index.md @@ -0,0 +1,97 @@ +Few of the Extended Markdown features + +#### Code +```{.py3 linenums="1" hl_lines="5-7"} +def insertion_sort(nums): + for i in range(1, len(nums)): + item_to_insert = nums[i] + j = i - 1 + while j >= 0 and nums[j] > item_to_insert: + nums[j + 1] = nums[j] + j -= 1 + nums[j + 1] = item_to_insert +``` + +#### Emoji + +:smile: :heart: :thumbsup: :100: :muscle: :accept: :point_up: :airplane: :champagne: :raised_hands: :boom: :laughing: :metal: :handshake: :older_man: :sheep: :no_entry: :mouse: :relieved: :question: :wink: :wave: :rainbow: :sleeping: + +#### Critic + +We Uber drivers never know whom we’re going to end up with as a passenger {--in the same car--}. +One day, I was driving over a new bridge, the design of which was very {~~confusing~>ugly~~}. +Completely confounded, {==I muttered==}{>>Actually I said it out loud<<}, “I’d love to meet the {~~genius~>retard~~} +who designed this mess.” With that, my passenger {==extended his hand in my direction==}{>>I thought he wanted to choke me<<} +and said, “Well, today is your {--*very*--} lucky day. My name is Mike, I work for the county engineer’s office, +and I’m the {==genius==}{>>obviously an irony<<} who designed this!”. Surprisingly, he still gave me a tip {++**of 2 dollars**++}. + +#### Keys + +++enter++ ++tab++ ++space++ ++arrow-up++ ++arrow-down++ ++page-up++ ++home++ ++backspace++ ++insert++ + +#### Tabls, lists & admonitions + +!!! example "Tasklist" + === "Output" + - [X] Plans at work + * [X] Make vanilla pudding. Put in mayo jar. Eat in the office during the lunch break + * [X] Wear shirt that says “Life”. Hand out lemons to colleagues. + * [ ] Hire two private investigators. Get them to follow each other. + - [ ] Personal plans + * [X] Make an alcoholic beverage and name it “responsibly.” Start drinking Responsibly. + * [ ] Sneeze in front of the Pope. Get blessed. + * [ ] Buy a horse, name it “Oscar Takes The Lead,” enter it in horse races. + + === "Markdown" + ``` + - [X] Plans at work + * [X] Make vanilla pudding. Put in mayo jar. Eat in the office during the lunch break + * [X] Wear shirt that says “Life”. Hand out lemons to colleagues. + * [ ] Hire two private investigators. Get them to follow each other. + - [ ] Personal plans + * [X] Make an alcoholic beverage and name it “responsibly.” Start drinking Responsibly. + * [ ] Sneeze in front of the Pope. Get blessed. + * [ ] Buy a horse, name it “Oscar Takes The Lead,” enter it in horse races. + ``` + +#### Tables + +**Substance** | **Description** +:--- | ---: +**Bombastium** | Rarest element in the world. Dropped into a barrel of water becomes one barrel of ice cream +**Jerktonium** | Ingestion of jerktonium causes a bad attitude, but the effects are curable by song. +**Philote** | The smallest possible particle, occupying no space at all. + +#### Formulas + +$$ +\left(\frac{\left(\sqrt{\frac{73^2}{12x}}\sqrt{\frac{x|x|}{\log_x}}\right)}{\sqrt[3]{\frac xy}}\right) +$$ + +#### Diargams + +```mermaid +classDiagram + Animal <|-- Duck + Animal <|-- Fish + Animal <|-- Zebra + class Animal{ + +int age + +String gender + +isMammal() + +mate() + } + class Duck{ + +String beakColor + +swim() + +quack() + } + class Fish{ + -int sizeInFeet + -canEat() + } + class Zebra{ + +bool is_wild + +run() + } +``` \ No newline at end of file diff --git a/workspaces/mkdocs-magicspace/examples/mkdocs-material/mkdocs.yml b/workspaces/mkdocs-magicspace/examples/mkdocs-material/mkdocs.yml new file mode 100644 index 0000000..96ddaed --- /dev/null +++ b/workspaces/mkdocs-magicspace/examples/mkdocs-material/mkdocs.yml @@ -0,0 +1,99 @@ +# =========================================================== +# NAVIGATION +# =========================================================== + +nav: + - Home: index.md + + +# =========================================================== +# CONFIGURATION +# =========================================================== + +site_name: MkDocs Showcase +edit_uri: "" + +# =========================================================== +# APPEARANCE +# =========================================================== + +theme: + name: 'material' + icon: + repo: fontawesome/brands/github + features: + - search.suggest + palette: + - scheme: default + toggle: + icon: material/weather-sunny + name: Switch to light mode + primary: indigo + accent: blue + - scheme: slate + toggle: + icon: material/weather-night + name: Switch to dark mode + primary: deep orange + accent: red + +extra: + # Link to open when your logo is clicked + homepage: https://alnoda.org + host_url: http://localhost + +plugins: + - search + - include-markdown + # Enable Macros and jinja2 templates + - awesome-pages + # mermaid2 diagrams: https://mermaid-js.github.io/mermaid/#/ + - mermaid2: + arguments: + theme: forest # default, forest, dark, neutral, base + themeCSS: ".er.entityLabel{fill: black;} .messageLine0{stroke: orange;} .messageLine1{stroke: orange;} #arrowhead{fill: orange;} .messageText{fill: black; stroke: black}" + + +markdown_extensions: + - def_list + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.arithmatex: + generic: true + - admonition + - pymdownx.inlinehilite + - pymdownx.details + - pymdownx.superfences: + # make exceptions to highlighting of code: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:mermaid2.fence_mermaid + - pymdownx.tabbed + - abbr + - pymdownx.snippets + - attr_list + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + - pymdownx.keys + - pymdownx.betterem + - pymdownx.caret + - pymdownx.critic + - pymdownx.escapeall + - pymdownx.smartsymbols + - pymdownx.tilde: + smart_delete: true + - footnotes + + +extra_javascript: + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + - https://unpkg.com/mermaid/dist/mermaid.min.js + + + + + + diff --git a/workspaces/mkdocs-magicspace/mkdocs/Magicspace-web.png b/workspaces/mkdocs-magicspace/mkdocs/Magicspace-web.png new file mode 100644 index 0000000..71b4cfb Binary files /dev/null and b/workspaces/mkdocs-magicspace/mkdocs/Magicspace-web.png differ diff --git a/workspaces/mkdocs-magicspace/mkdocs/helpers.py b/workspaces/mkdocs-magicspace/mkdocs/helpers.py new file mode 100644 index 0000000..b073784 --- /dev/null +++ b/workspaces/mkdocs-magicspace/mkdocs/helpers.py @@ -0,0 +1,58 @@ +""" +Basic example of a Mkdocs-macros module. +Include this {{ macros_info() }} in any page to get complete macro info +""" +import os + +port_increments = { + "DOCS_URL": 0, + "FILEBROWSER_URL": 1, + "STATICFS_URL": 2, + "CRONICLE_URL": 3, + "UNGIT_URL": 4, + "IDE_URL": 5, + "TERMINAL_URL": 6, + "MC_URL": 7, + "HTOP_URL": 8, + "MKDOCS_LIVE": 10 + } + +# this function name should not be changed +def define_env(env): + """ + This is the hook for defining variables, macros and filters + - variables: the dictionary that contains the environment variables + - macro: a decorator function, to declare a macro. + - filter: a function with one of more arguments, + used to perform a transformation + """ + @env.macro + def get_tool_url(env): + try: + return os.environ[env] + except: + # Get host + host = "localhost" + try: + host = os.environ["WRK_HOST"] + except: + pass + proto = "http" + try: + proto = os.environ["WRK_PROTO"] + except: + pass + # Entry port - port relative to which other ports will be calculated + entry_port = 8020 + try: + entry_port = int(os.environ["ENTRY_PORT"]) + except: + pass + # Assign port + try: + port = port_increments[env] + entry_port + except: + port = 80 + return f"{proto}://{host}:{port}" + + \ No newline at end of file diff --git a/workspaces/mkdocs-magicspace/mkdocs/home.md b/workspaces/mkdocs-magicspace/mkdocs/home.md new file mode 100644 index 0000000..a9ce0f6 --- /dev/null +++ b/workspaces/mkdocs-magicspace/mkdocs/home.md @@ -0,0 +1,133 @@ + + + +{% + set tools = [ + { + "env": "IDE_URL", + "name": "IDE", + "image": "IDE.jpg", + "description": "Browser-based version of Visual Studio Code. Develop in any language, install hundreeds of extensions" + }, + { + "env": "TERMINAL_URL", + "name": "Terminal", + "image": "Terminal.png", + "description": "Full-fledged browser-based terminal with Z-shell" + }, + { + "env": "FILEBROWSER_URL", + "name": "File Browser", + "image": "Filebrowser.png", + "description": "Browse, upload and download files and folders to and from the Workspace" + }, + { + "env": "MKDOCS_LIVE", + "name": "MkDocs live server", + "image": "Magicspace-web.png", + "description": "Serve your MkDocs project with live reload. For example, cd /home/examples/mkdocs-material; mkdocs serve -a 0.0.0.0:8030" + }, + { + "env": "CRONICLE_URL", + "name": "Cronicle", + "image": "Cronicle.jpg", + "description": "Schedule jobs, manage schedules, observe and monitor executions (user/pass - admin/admin)" + }, + { + "env": "UNGIT_URL", + "name": "Ungit", + "image": "Ungit.jpg", + "description": "Manage Git repositories and work flow using beautiful UI" + }, + { + "env": "STATICFS_URL", + "name": "Static File Server", + "image": "Static-server.png", + "description": "Serve any static websites like a breeze" + }, + { + "env": "MC_URL", + "name": "M.Commander", + "image": "MC.jpg", + "description": "Feature rich visual file manager with internal text viewer and editor" + }, + { + "env": "HTOP_URL", + "name": "Process monitor", + "image": "Htop.jpg", + "description": "Monitor running process and resource utilization" + } + ] +%} + + +
+ {% for tool in tools %} + {% set tool_url = get_tool_url(tool.env) %} +
+ + + + +
{{ tool.name }}
+
+
{{ tool.description }}
+
+ {% endfor %} +
+ + + + + diff --git a/workspaces/python-workspace/Dockerfile b/workspaces/python-workspace/Dockerfile index 1977b29..cef63fe 100644 --- a/workspaces/python-workspace/Dockerfile +++ b/workspaces/python-workspace/Dockerfile @@ -1,5 +1,5 @@ ARG docker_registry=docker.io/alnoda -ARG image_tag=18.04-0.9 +ARG image_tag=18.04-0.11 FROM ${docker_registry}/workspace-in-docker:${image_tag} diff --git a/workspaces/python-workspace/README.md b/workspaces/python-workspace/README.md index 2cdc17f..70c94ed 100644 --- a/workspaces/python-workspace/README.md +++ b/workspaces/python-workspace/README.md @@ -1,6 +1,6 @@ # Python workspace -Python development enviroment inside the isolated docker container. Includes VS-code IDE, +Python development environment inside the isolated docker container. Includes VS-code IDE, job scheduler and other tools for linting, testing, auto-documentation and profiling.

diff --git a/workspaces/python-workspace/python-requirements.txt b/workspaces/python-workspace/python-requirements.txt index d29350c..4fa6779 100644 --- a/workspaces/python-workspace/python-requirements.txt +++ b/workspaces/python-workspace/python-requirements.txt @@ -31,3 +31,4 @@ pytest-regressions==2.2.0 logzero==1.7.0 pylint==2.10.2 +jupyter==1.0.0 diff --git a/workspaces/redis-workspace/mkdocs/macros/helpers.py b/workspaces/redis-workspace/mkdocs/macros/helpers.py index 0ecda60..66a5ee0 100644 --- a/workspaces/redis-workspace/mkdocs/macros/helpers.py +++ b/workspaces/redis-workspace/mkdocs/macros/helpers.py @@ -29,7 +29,7 @@ def define_env(env): @env.macro def get_tool_url(env): try: - return os.environ[name] + return os.environ[env] except: # Get host host = "localhost" diff --git a/workspaces/workspace-in-docker/mkdocs/macros/helpers.py b/workspaces/workspace-in-docker/mkdocs/macros/helpers.py index f41c074..11e499b 100644 --- a/workspaces/workspace-in-docker/mkdocs/macros/helpers.py +++ b/workspaces/workspace-in-docker/mkdocs/macros/helpers.py @@ -28,7 +28,7 @@ def define_env(env): @env.macro def get_tool_url(env): try: - return os.environ[name] + return os.environ[env] except: # Get host host = "localhost"