Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple webapp for config #1616

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
29a53c5
Initial working server + client for modifying config, running commands
summerisgone Oct 13, 2019
7dd4044
Initial webapp version
summerisgone Oct 14, 2019
b9bffa3
Update requirements.txt
summerisgone Oct 14, 2019
4867a03
Replaced shell with playbook CLI, structured js app
summerisgone Nov 21, 2019
28ac131
Added loading indication for DO regions
summerisgone Feb 25, 2020
42650e2
Copy-pasted playbook CLI, passing host vars as result
summerisgone Feb 25, 2020
9ee5238
WIP splitting into modules
summerisgone Mar 12, 2020
34211a0
added DO provider module
summerisgone Mar 12, 2020
992b2d6
Added full-page steps with transitions
summerisgone Apr 1, 2020
32a8b08
Removed do regions request, re-added run and status
summerisgone Apr 1, 2020
2a22234
Improved secret gathering
summerisgone Apr 4, 2020
89c2330
App cleanup
summerisgone Apr 4, 2020
dd2a05a
Docker env, added save&exit step
summerisgone May 15, 2020
8156687
Better variable gathering, fixed empty DNS IP
summerisgone May 18, 2020
2f9fa4d
Draft amazon lightsail provider
summerisgone May 18, 2020
dfa2990
Lightsail provided added
summerisgone May 22, 2020
2da62f4
Added EC2 provider
summerisgone May 24, 2020
149e7dd
Draft for GCE
summerisgone Jul 12, 2020
97d3fab
Added GCE provider
summerisgone Jul 19, 2020
97a931d
Added Vultr provider
summerisgone Aug 7, 2020
12e7533
Added scaleway provider
summerisgone Aug 7, 2020
ca3230c
Improved error handling when vpn host not created
summerisgone Aug 8, 2020
80f04de
Updated DigitalOcean UX, proxied requests to it
summerisgone Oct 27, 2020
bfd0895
Updated playbook.py from recent ansible version
summerisgone Oct 27, 2020
16b5e55
Added region-select and env secrets to lightsail
summerisgone Oct 29, 2020
a8ccad9
Secrets from env for EC2 provider
summerisgone Oct 29, 2020
2aeb292
Unified UX for Vultr & Scaleway
summerisgone Nov 2, 2020
e887387
Added Hetzner provider
summerisgone Jan 20, 2021
00271f2
Added Azure provider
summerisgone Jan 26, 2021
01bd17d
Added Linode support
summerisgone Jan 27, 2021
465b8e6
WIP: CLoudStack provider
summerisgone Jan 29, 2021
27d21db
Added CloudStack (exoscale) provider setup
summerisgone May 29, 2021
7d2ddff
Updated Vultr provider UX
summerisgone May 29, 2021
6a72539
Minor updates
summerisgone May 29, 2021
15b0d1f
Added local and openstack providers
summerisgone May 29, 2021
76cb02b
Added README file
Aug 30, 2022
1668f6a
Merge remote-tracking branch 'tob/master' into 196-simple-webapp-config
summerisgone Aug 30, 2022
23f8332
Switched to ansible_runner API
summerisgone Aug 30, 2022
547711d
Show variables from event logs
summerisgone Sep 8, 2022
aa0fff0
More careful variable extraction, without regexp
summerisgone Sep 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/.dockerignore
@@ -0,0 +1,6 @@
*
!requirements.txt
!playbook.py
!server.py
!run.sh
!static
10 changes: 10 additions & 0 deletions app/Dockerfile
@@ -0,0 +1,10 @@
FROM algo
ARG BUILD_PACKAGES="gcc libffi-dev linux-headers make musl-dev openssl-dev"
COPY requirements.txt /app/requirements.txt
RUN apk --no-cache add ${BUILD_PACKAGES} && \
source .env/bin/activate && \
python3 -m pip --no-cache-dir install -r app/requirements.txt && \
apk del ${BUILD_PACKAGES}
COPY . app
RUN chmod 0755 /algo/app/run.sh
CMD [ "/algo/app/run.sh" ]
39 changes: 39 additions & 0 deletions app/README.md
@@ -0,0 +1,39 @@
# Algo web app UI

## Abstract

[A short description of what project does]

## Background

VUE docs,
asyncio docs

## Rationale

Why A not B
(vue is modern and doesn't require build system and depoendency)
asyncio - same
PBEX is patched because shell access considered insecure

## Implementation

app/server.py management, threading
config yaml writer
generic approach to provider UI (set required fields, validation, inherit ENV, try to detect)
how progress displayed

## testing
testing js: vue-test-library + loader
testing python: pytests
testing pbex compatibility: demo yaml

## Compatibility (if applicable)

[A discussion of the change with regard to the compatibility.]
Due to ansible doesn't have API, have to manually check if custom PBEX would still work

## Open issues (if applicable)

Still requires pip install, consider py2exe, pyinstaller
No task progress displayed, require callback module
3 changes: 3 additions & 0 deletions app/requirements.txt
@@ -0,0 +1,3 @@
aiohttp==3.8.1
ansible-runner==2.2.1
boto3
25 changes: 25 additions & 0 deletions app/run.sh
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -e

ALGO_DIR="/algo"
DATA_DIR="/data"

if [ -z ${VIRTUAL_ENV+x} ]
then
ACTIVATE_SCRIPT="/algo/.env/bin/activate"
if [ -f "$ACTIVATE_SCRIPT" ]
then
# shellcheck source=/dev/null
source "$ACTIVATE_SCRIPT"
else
echo "$ACTIVATE_SCRIPT not found. Did you follow documentation to install dependencies?"
exit 1
fi
fi

tr -d '\r' < "${DATA_DIR}"/config.cfg > "${ALGO_DIR}"/config.cfg
test -d "${DATA_DIR}"/configs && rsync -qLktr --delete "${DATA_DIR}"/configs "${ALGO_DIR}"/
python app/server.py
rsync -qLktr --delete "${ALGO_DIR}"/configs "${DATA_DIR}"/
exit ${retcode}