diff --git a/.gitignore b/.gitignore index 549ca9c49..d04e6ccac 100644 --- a/.gitignore +++ b/.gitignore @@ -166,5 +166,8 @@ runner.yml # command scripts for runner servers/execution/runner/lifecycle* +# Python virtual-env +dtaas-venv/ + # certs *.pem \ No newline at end of file diff --git a/docs/developer/index.md b/docs/developer/index.md index 3341797e8..d82ba72fc 100644 --- a/docs/developer/index.md +++ b/docs/developer/index.md @@ -76,6 +76,9 @@ powershell -F script/docker.ps1 about 5GB of bandwidth and 15GB of space. You will have to download the docker images on a really good network. + + ## :building_construction: Development Workflow To manage collaboration by multiple developers on the software, a development workflow is in place. Each developer should follow these steps: + + 1. Fork of the main repository into your github account. 1. Setup [Code Climate](https://docs.codeclimate.com/docs/getting-started-with-code-climate) @@ -120,10 +130,11 @@ a development workflow is in place. Each developer should follow these steps: [Codecov](https://docs.codecov.com/docs/quick-start) for your fork. The codecov does not require secret token for public repositories. -1. Install git-hooks for the project. +1. nvm use 22 (if nvm or node isn't installed) 1. Use [Fork, Branch, PR](https://gun.io/news/2017/01/how-to-github-fork-branch-and-pull-request/) workflow. +1. Active the Python Virtual Enviornment by calling (`./dtaas-venv/bin/activate`) 1. Work in your fork and open a PR from your working branch to your `feature/distributed-demo` branch. The PR will run all the github actions, code climate and codecov checks. diff --git a/script/base.sh b/script/base.sh index 5912f1a39..344cd33d5 100755 --- a/script/base.sh +++ b/script/base.sh @@ -14,7 +14,8 @@ sudo apt-get install -y \ apache2-utils \ net-tools \ python3-dev \ - python3-pip + python3-pip \ + python3-env sudo mkdir -p /etc/apt/keyrings if [ ! -f /etc/apt/keyrings/docker.gpg ] @@ -26,7 +27,7 @@ then fi sudo apt-get update -y -sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin +sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo groupadd docker || true sudo usermod -aG docker "$USER" || true @@ -52,27 +53,15 @@ docker run hello-world sudo systemctl enable docker.service sudo systemctl enable containerd.service - -#install docker-compose from https://docs.docker.com/compose/install/other/ -sudo curl -SL "https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-linux-x86_64" \ - -o /usr/local/bin/docker-compose -sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose -sudo chmod 755 /usr/local/bin/docker-compose /usr/bin/docker-compose - - # Install nodejs environment sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg -sudo mkdir -p /etc/apt/keyrings -if [ ! -f /etc/apt/keyrings/nodesource.gpg ] -then - curl -fsSL "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" | \ - sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg -fi -NODE_MAJOR=20 -printf "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] \ - https://deb.nodesource.com/node_%s.x nodistro main" "$NODE_MAJOR" | \ - sudo tee /etc/apt/sources.list.d/nodesource.list +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + +nvm install 22 +nvm use 22 sudo apt-get update sudo apt-get install -y nodejs diff --git a/script/env.sh b/script/env.sh index 2c1e71b16..df7691efa 100755 --- a/script/env.sh +++ b/script/env.sh @@ -11,12 +11,20 @@ npx --yes playwright install-deps #------------- printf "\n\n Installing required python packages...." sudo apt install -y python3-pip -sudo -H pip3 install mkdocs -sudo -H pip3 install mkdocs-material -sudo -H pip3 install python-markdown-math -sudo -H pip3 install mkdocs-open-in-new-tab -sudo -H pip3 install mkdocs-with-pdf -sudo -H pip3 install qrcode + +python3 -m venv ./dtaas-venv + +chmod +x ./dtaas-venv/bin/activate +./dtaas-venv/bin/activate + +./dtaas-venv/bin/pip3 install mkdocs +./dtaas-venv/bin/pip3 install mkdocs-material +./dtaas-venv/bin/pip3 install python-markdown-math +./dtaas-venv/bin/pip3 install mkdocs-open-in-new-tab +./dtaas-venv/bin/pip3 install mkdocs-with-pdf +./dtaas-venv/bin/pip3 install qrcode + +deactivate # Install markdownlint sudo apt-get install -y rubygems