-
Notifications
You must be signed in to change notification settings - Fork 60
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
Updates install scripts #150
Changes from 7 commits
55f45e5
4e25685
736330d
aa9ada6
e632c3b
175b097
1bfa2b5
9dec00a
6e82be9
8903448
16287ff
1990e87
b3941ea
fe20d71
ea08075
cc6530b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
all | ||
exclude_rule 'MD033' | ||
rule 'MD013', :code_blocks => false, :tables => false | ||
rule 'MD013', :ignore_code_blocks => true, :tables => false | ||
rule 'MD046', :style => :fenced |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,11 @@ sudo mkdir -p /etc/apt/keyrings | |
if [ ! -f /etc/apt/keyrings/docker.gpg ] | ||
then | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | ||
sudo printf \ | ||
"deb [arch=%s signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | ||
%s stable" "$(dpkg --print-architecture)" "$(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
printf \ | ||
"deb [arch=%s signed-by=/etc/apt/keyrings/docker.gpg] \ | ||
https://download.docker.com/linux/ubuntu %s stable" \ | ||
"$(dpkg --print-architecture)" "$(lsb_release -cs)" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
fi | ||
|
||
sudo apt-get update -y | ||
|
@@ -58,14 +60,30 @@ sudo systemctl enable docker.service | |
sudo systemctl enable containerd.service | ||
|
||
|
||
# Install nodejs environment | ||
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash - | ||
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=18 | ||
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 | ||
sudo apt-get update | ||
sudo apt-get install -y nodejs | ||
sudo npm install -g [email protected] | ||
|
||
|
||
if [ ! -f /usr/share/keyrings/yarnkey.gpg ] | ||
then | ||
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null | ||
printf "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list | ||
curl -sL "https://dl.yarnpkg.com/debian/pubkey.gpg" | gpg --dearmor | \ | ||
sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null | ||
printf "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] \ | ||
https://dl.yarnpkg.com/debian stable main \n" | \ | ||
sudo tee /etc/apt/sources.list.d/yarn.list | ||
fi | ||
|
||
sudo apt-get update -y | ||
|
@@ -78,12 +96,8 @@ printf "\n\n End of installing dependencies...\n\n\n " | |
# get the required docker images | ||
printf "Download the required docker images...\n " | ||
printf ".........\n\n\n " | ||
docker pull traefik:v2.5 | ||
docker pull influxdb:2.4 | ||
docker pull traefik:v2.10 | ||
docker pull mltooling/ml-workspace:0.13.2 | ||
docker pull grafana/grafana | ||
docker pull telegraf | ||
docker pull gitlab/gitlab-ce:15.10.0-ce.0 | ||
printf "\n\n docker images successfully downloaded...\n \n \n " | ||
#---- | ||
|
||
|
@@ -128,7 +142,7 @@ yarn build | |
{ | ||
printf "PORT='4001'\n " | ||
printf "MODE='local'\n " | ||
printf "LOCAL_PATH ='%s'\n " "$TOP_DIR" | ||
printf "LOCAL_PATH ='%s/files'\n " "$TOP_DIR" | ||
printf "GITLAB_GROUP ='dtaas'\n " | ||
printf "GITLAB_URL='https://gitlab.com/api/graphql'\n " | ||
printf "TOKEN='123-sample-token'\n " | ||
|
@@ -146,7 +160,7 @@ docker run -d \ | |
-p 8090:8080 \ | ||
--name "ml-workspace-user1" \ | ||
-v "${TOP_DIR}/files/user1:/workspace" \ | ||
-v "${TOP_DIR}/files/common:/workspace/common:ro" \ | ||
-v "${TOP_DIR}/files/common:/workspace/common" \ | ||
--env AUTHENTICATE_VIA_JUPYTER="" \ | ||
--env WORKSPACE_BASE_URL="user1" \ | ||
--shm-size 512m \ | ||
|
@@ -157,7 +171,7 @@ docker run -d \ | |
-p 8091:8080 \ | ||
--name "ml-workspace-user2" \ | ||
-v "${TOP_DIR}/files/user2:/workspace" \ | ||
-v "${TOP_DIR}/files/common:/workspace/common:ro" \ | ||
-v "${TOP_DIR}/files/common:/workspace/common" \ | ||
--env AUTHENTICATE_VIA_JUPYTER="" \ | ||
--env WORKSPACE_BASE_URL="user2" \ | ||
--shm-size 512m \ | ||
|
@@ -177,7 +191,7 @@ docker run -d \ | |
-v "$PWD/auth:/etc/traefik/auth" \ | ||
-v "$PWD/dynamic:/etc/traefik/dynamic" \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
traefik:v2.5 || true | ||
traefik:v2.10 || true | ||
|
||
|
||
#---------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,61 @@ | ||
# DTaaS Boxes | ||
# DTaaS Vagrant Box | ||
|
||
This is a box that has the following items: | ||
This README provides instructions on creating a custom Operating System | ||
virtual disk for running the DTaaS software. The virtual disk is managed | ||
by **vagrant**. The purpose is two fold: | ||
|
||
* docker | ||
* nodejs and yarn | ||
* jupyter | ||
* microk8s | ||
* Provide cross-platform installation of the DTaaS application. Any operating system supporting use of vagrant software utility can support installation of the DTaaS software. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line length There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @astitva1905 If the line is broken into two lines, then another error comes:
do you know of a good way to resolve this problem? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes Prasad |
||
* Create a ready to use development environment for code contributors. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lists should be surrounded by blank lines |
||
|
||
There are two scripts in this directory: | ||
|
||
| Script name | Purpose | Default | | ||
|:---|:---|:---| | ||
| `user.sh` | user installation | :white_check_mark: | | ||
| `developer.sh` | developer installation | :x: | | ||
|
||
If you are installing the DTaaS for developers, the default installation | ||
caters to your needs. You can skip the next step and continue with the | ||
creation of vagrant box. | ||
|
||
If you are a developer and would like additional software installed, you need | ||
to modify `Vagrantfile`. The existing `Vagrantfile` has two lines: | ||
|
||
```sh | ||
config.vm.provision "shell", path: "user.sh" | ||
#config.vm.provision "shell", path: "developer.sh" | ||
``` | ||
|
||
Uncomment the second line to have more software components installed. If you | ||
are not a developer, no changes are required to the `Vagrantfile`. | ||
|
||
This vagrant box installed for users will have the following items: | ||
|
||
* docker v24.0 | ||
* nodejs v18.8 | ||
* yarn v1.22 | ||
* npm v10.2 | ||
* containers | ||
* ml-workspace v0.13 | ||
* traefik v2.10 | ||
* gitlab-ce v16.4 | ||
* influxdb v2.7 | ||
* grafana v10.1 | ||
* rabbitmq v3-management | ||
* eclipse-mosquitto (mqtt) v2 | ||
|
||
This vagrant box installed for developers will have | ||
the following items additional items: | ||
|
||
* docker-compose v2.20 | ||
* microk8s v1.27 | ||
* jupyterlab | ||
* mkdocs | ||
* containers | ||
* mltooling/ml-workspace:0.13.2 | ||
* traefik2.5 | ||
* influxdb2.4 | ||
* grafana | ||
* telegraf | ||
* gitlab | ||
* telegraf v1.28 | ||
|
||
Publish a base virtualbox package to be used by | ||
vagrant to publish all other virtualbox packages | ||
The upcoming instructions will help with the creation of | ||
base vagrant box. | ||
|
||
```bash | ||
#create a key pair | ||
|
@@ -26,7 +66,6 @@ mv key.pub vagrant.pub | |
vagrant up | ||
|
||
# let the provisioning be complete | ||
# replace the vagrant ssh key-pair with personal one | ||
vagrant ssh | ||
|
||
# install the oh-my-zsh | ||
|
@@ -37,6 +76,7 @@ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-m | |
# inside ~/.zshrc, modify the following line | ||
plugins=(git zsh-autosuggestions history cp tmux) | ||
|
||
# to replace the vagrant ssh key-pair with personal one | ||
# remove the vagrant default public key - first line of | ||
# /home/vagrant/.ssh/authorized_keys | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
# Installs necessary packages to create the docker environment for | ||
# executing the DTaaS application | ||
|
||
apt-get update -y | ||
apt-get upgrade -y | ||
|
||
#install docker-compose from https://docs.docker.com/compose/install/other/ | ||
curl -SL "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-linux-x86_64" \ | ||
-o /usr/local/bin/docker-compose | ||
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose | ||
chmod 755 /usr/local/bin/docker-compose /usr/bin/docker-compose | ||
|
||
# Install openssl for certificate generation | ||
apt-get install -y wget openssl | ||
|
||
# Install playwright tool for integration tests on browsers | ||
npx playwright install-deps | ||
|
||
#------------- | ||
printf "\n\n Install jupyterlab and mkdocs" | ||
pip install jupyterlab | ||
pip install mkdocs | ||
pip3 install mkdocs-material | ||
pip3 install python-markdown-math | ||
pip3 install mkdocs-open-in-new-tab | ||
pip3 install mkdocs-with-pdf | ||
pip3 install qrcode | ||
|
||
# Install minimal Kubernetes cluster | ||
snap install microk8s --classic | ||
usermod -a -G microk8s vagrant | ||
chown -f -R vagrant ~/.kube | ||
newgrp microk8s | ||
|
||
# get the required docker images | ||
docker pull telegraf:1.28.2 | ||
|
||
# Install markdownlint | ||
sudo gem install mdl | ||
|
||
# Install madge for generating dependency graphs of typescript projects | ||
sudo apt-get install graphviz | ||
sudo npm install -g madge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use variables in the printf format string. Use printf "..%s.." "$foo".