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

Introduce new VM size #32

Merged
merged 18 commits into from
Dec 23, 2024
18 changes: 10 additions & 8 deletions templates/workspace_services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ Workspace Templates are located in this folder. These Templates are for the Comp

| CPU | GPU / RAM | Price | Size |
| --- | --- | --- | --- |
| 2 CPU | 4GB | £0.05 / hour | Standard_B2s
| 2 CPU | 8GB | £0.15 / hour | Standard_D2s_v5
| 4 CPU | 16GB | £0.30 / hour | Standard_D4s_v5
| 8 CPU | 32GB | £0.65 / hour | Standard_D8s_v5
| 8 CPU | 64GB | £0.75 / hour | Standard_E8as_v4
| 16 CPU | 64GB | £1.25 / hour | Standard_D16s_v5
| 6 CPU - 112GB RAM | 1 GPU - 16GB | £3.21 / hour | Standard_NC6s_v3
| 12 CPU - 224GB RAM | 2 GPU - 32GB | £6.42 / hour | Standard_NC12s_v3
| 2 CPU | 4GB | £0.05 / hour | Standard_B2s
| 2 CPU | 8GB | £0.15 / hour | Standard_D2s_v5
| 4 CPU | 16GB | £0.30 / hour | Standard_D4s_v5
| 8 CPU | 32GB | £0.65 / hour | Standard_D8s_v5
| 8 CPU | 64GB | £0.75 / hour | Standard_E8as_v4
| 16 CPU | 64GB | £1.25 / hour | Standard_D16s_v5
| 6 CPU | 55GB RAM - 1 A10 GPU | £0.45 / hour | Standard_NV6ads_A10_v5
| 6 CPU - 112GB RAM | 1 GPU - 16GB | £3.21 / hour | Standard_NC6s_v3
| 12 CPU - 224GB RAM | 2 GPU - 32GB | £6.42 / hour | Standard_NC12s_v3


## Current VM Image options

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-service-guacamole-linuxvm-ouh2
version: 1.0.16
version: 1.0.2
description: "An Azure TRE User Resource Template for Guacamole (Linux)"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand All @@ -15,8 +15,9 @@ custom:
"8 CPU | 32GB RAM | £0.35 / hour": Standard_D8s_v5
"8 CPU | 64GB RAM | £0.45 / hour": Standard_E8as_v4
"16 CPU | 64GB RAM | £0.65 / hour": Standard_D16s_v5
"6 CPU - 112GB RAM | 1 GPU - 16GB RAM | £2.98 / hour": Standard_NC6s_v3
"12 CPU - 224GB RAM | 2 GPU - 32GB RAM | £5.96 / hour": Standard_NC12s_v3
"6 CPU - 55GB RAM | 1 A10 GPU - 4GB RAM | £0.45 / hour": Standard_NV6ads_A10_v5
"6 CPU - 112GB RAM | 1 V100 GPU - 16GB RAM | £3 / hour": Standard_NC6s_v3
"12 CPU - 224GB RAM | 2 V100 GPU - 32GB RAM | £6 / hour": Standard_NC12s_v3
image_options:
"Ubuntu 22.04 LTS":
source_image_reference:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
"8 CPU | 32GB RAM | £0.35 / hour",
"8 CPU | 64GB RAM | £0.45 / hour",
"16 CPU | 64GB RAM | £0.65 / hour",
"6 CPU - 112GB RAM | 1 GPU - 16GB RAM | £2.98 / hour",
"12 CPU - 224GB RAM | 2 GPU - 32GB RAM | £5.96 / hour"
"6 CPU - 55GB RAM | 1 A10 GPU - 4GB RAM | £0.45 / hour",
"6 CPU - 112GB RAM | 1 V100 GPU - 16GB RAM | £3 / hour",
"12 CPU - 224GB RAM | 2 V100 GPU - 32GB RAM | £6 / hour"
],
"updateable": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ if [ "${SHARED_STORAGE_ACCESS}" -eq 1 ]; then
sudo chmod 600 "$smbCredentialFile"

# Configure autofs
echo "$fileShareName -fstype=cifs,rw,dir_mode=0777,credentials=$smbCredentialFile :$smbPath" | sudo tee /etc/auto.fileshares > /dev/null
echo "$fileShareName -fstype=cifs,rw,file_mode=0777,dir_mode=0777,credentials=$smbCredentialFile :$smbPath" | sudo tee /etc/auto.fileshares > /dev/null
echo "$mntRoot /etc/auto.fileshares --timeout=60" | sudo tee /etc/auto.master > /dev/null

# Restart service to register changes
Expand All @@ -127,11 +127,60 @@ wget "${NEXUS_PROXY_URL}"/repository/r-studio-download/electron/jammy/amd64/rstu
wget "${NEXUS_PROXY_URL}"/repository/r-studio-download/electron/focal/amd64/rstudio-2023.12.1-402-amd64.deb -P /tmp/2004
sudo gdebi --non-interactive /tmp/"${APT_SKU}"/rstudio-2023.12.1-402-amd64.deb

# R config
sudo echo -e "local({\n r <- getOption(\"repos\")\n r[\"Nexus\"] <- \"""${NEXUS_PROXY_URL}/repository/r-proxy/\"\n options(repos = r)\n})" | sudo tee /etc/R/Rprofile.site


# Fix for blank screen on DSVM (/sh -> /bash due to conflict with profile.d scripts)
sudo sed -i 's|!/bin/sh|!/bin/bash|g' /etc/xrdp/startwm.sh

# Add a README file to the Desktop
# README_PATH="/home/$VM_USER/Desktop/README.txt"
# sudo -u "$VM_USER" bash -c "cat > $README_PATH" << 'EOF'
# Welcome to your Linux VM!

# This VM is pre-configured with the following tools:
# - XFCE Desktop Environment
# - Azure Storage Explorer
# - RStudio Desktop
# - Docker
# - Anaconda

# To get started:
# 1. Open any application using the Applications Menu.
# 2. Use RStudio or Jupyter Notebook for data analysis.
# 3. Access your shared file storage at /fileshares/vm-shared-storage (if configured).
# 4. See the package mirror options by accessing http://nexus-tvstre.uksouth.cloudapp.azure.com

# Recommendations:
# 1. R packages may fail to install initially. If you see an error, edit Rprofile to use the local package mirror:

# sudo nano /usr/lib/R/etc/Rprofile.site

# Replace the local(...) lines at the bottom with:
# local({
# r <- getOption("repos")
# r["Nexus"] <- "http://nexus-tvstre.uksouth.cloudapp.azure.com/repository/r-proxy/"
# options(repos = r)
# })

# 2. Disable XFCE Lock Screen otherwise you may get locked out:

# Open Applications > Settings > Screensaver; click on Lock Screen tab, disable the Lock Screen.


# For further assistance, contact your administrator.

# Enjoy!
# EOF

# Set appropriate permissions for the README file
sudo chmod 644 "$README_PATH"
sudo chown "$VM_USER:$VM_USER" "$README_PATH"


### Anaconda Config
if [ "${CONDA_CONFIG}" -eq 1 ]; then
if [ "${CONDA_CONFIG}" == "true" ]; then
export PATH="/opt/anaconda/condabin":$PATH
export PATH="/opt/anaconda/bin":$PATH
export PATH="/opt/anaconda/envs/py38_default/bin":$PATH
Expand All @@ -143,25 +192,35 @@ if [ "${CONDA_CONFIG}" -eq 1 ]; then
fi

# Docker install and config
sudo apt-get remove -y moby-tini || true
sudo apt-get update
sudo apt-get install -y r-base-core
sudo apt-get install -y ca-certificates curl gnupg lsb-release
sudo apt-get install -y docker-compose-plugin docker-ce-cli containerd.io jq
sudo apt-get install -y docker-ce
jq -n --arg proxy "${NEXUS_PROXY_URL}:8083" '{"registry-mirrors": [$proxy]}' > /etc/docker/daemon.json
sudo systemctl daemon-reload
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin jq
# Create Docker config directory if it doesn't exist
sudo mkdir -p /etc/docker/
# Configure Docker registry mirrors
jq -n --arg proxy "${NEXUS_PROXY_URL}:8083" '{"registry-mirrors": [$proxy]}' | sudo tee /etc/docker/daemon.json > /dev/null
# Restart Docker service to apply configuration
sudo systemctl restart docker

# Jupiter Notebook Config
sudo sed -i -e 's/Terminal=true/Terminal=false/g' /usr/share/applications/jupyter-notebook.desktop

# R config
sudo echo -e "local({\n r <- getOption(\"repos\")\n r[\"Nexus\"] <- \"""${NEXUS_PROXY_URL}/repository/r-proxy/\"\n options(repos = r)\n})" | sudo tee /etc/R/Rprofile.site
## Prevent screen timeout and lock screen
echo "init_vm.sh: Disabling lock screen"

# Prevent screen timeout
echo "init_vm.sh: Preventing Timeout"
# Remove xfce4-screensaver (to disable screen saver)
sudo apt-get remove xfce4-screensaver -y

# Disable lock screen using gsettings
gsettings set org.gnome.desktop.screensaver lock-enabled false
gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

# Disable lock screen via XFCE Power Manager settings
xfconf-query -c xfce4-power-manager -p /general/lockscreen-suspend-hibernate -s false
xfconf-query -c xfce4-power-manager -p /general/lockscreen -s false


## Cleanup
echo "init_vm.sh: Cleanup"
sudo shutdown -r now
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-service-guacamole-windowsvm-ouh2
version: 1.0.3
version: 1.0.5
description: "An Azure TRE User Resource Template for Guacamole (Windows 10)"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand All @@ -15,8 +15,9 @@ custom:
"8 CPU | 32GB RAM | £0.65 / hour": Standard_D8s_v5
"8 CPU | 64GB RAM | £0.75 / hour": Standard_E8as_v4
"16 CPU | 64GB RAM | £1.25 / hour": Standard_D16s_v5
"6 CPU - 112GB RAM | 1 GPU - 16GB RAM | £3.21 / hour": Standard_NC6s_v3
"12 CPU - 224GB RAM | 2 GPU - 32GB RAM | £6.42 / hour": Standard_NC12s_v3
"6 CPU - 55GB RAM | 1 A10 GPU - 4GB RAM | £0.70 / hour": Standard_NV6ads_A10_v5
"6 CPU - 112GB RAM | 1 V100 GPU - 16GB RAM | £3.21 / hour": Standard_NC6s_v3
"12 CPU - 224GB RAM | 2 V100 GPU - 32GB RAM | £6.42 / hour": Standard_NC12s_v3
image_options:
"Windows 10":
source_image_reference:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"8 CPU | 32GB RAM | £0.65 / hour",
"8 CPU | 64GB RAM | £0.75 / hour",
"16 CPU | 64GB RAM | £1.25 / hour",
"6 CPU - 55GB RAM | 1 A10 GPU - 4GB RAM | £0.70 / hour",
"6 CPU - 112GB RAM | 1 GPU - 16GB RAM | £3.21 / hour",
"12 CPU - 224GB RAM | 2 GPU - 32GB RAM | £6.42 / hour"
],
Expand Down
Loading