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

Add hic-windows-nicedcv-example #39

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions configs/hic-windows-nicedcv-example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: "hic-windows-nicedcv-example"

base:
# E.g. DCV-Windows-2023.1.16388-DOD-78-2023-12-20T09-36-56.648Z
name: "DCV-Windows-2023*-DOD-*"
owner: "amazon"

template:
name: windows

# subnet_id:

instance:
type: t3.2xlarge
volume_size: 50

env:
- "AUTOHIBERNATE_TIME=120"

modules:
- aws_ec2launch
- 7zip
- conda
- dbeaver
- firefox
- libreoffice
- notepad++
- rstudio
- ssms
- vscode
- autohibernate

files:
- src: conda-envs/example.yml
dst: conda-environment.yml
9 changes: 6 additions & 3 deletions modules/conda-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ for env in "${SETUPDIR}"/conda-environment*.yml ; do
~/conda/bin/mamba env update --file "$env"
done

echo "Setting default conda channel"
cat > "$HOME/.condarc" <<EOF
# Internal Conda proxy or repository
if [ -n "${CONDA_PROXY_SERVER:-}" ]; then
echo "Configuring Conda proxy ${CONDA_PROXY_SERVER}"
cat > "$HOME/.condarc" <<EOF
channels:
- conda-forge
channel_alias: http://conda.hic-tre.dundee.ac.uk
channel_alias: ${CONDA_PROXY_SERVER}
EOF
fi
14 changes: 9 additions & 5 deletions modules/conda.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ if ( Test-Path -Path ${BASE_ENVIRONMENT_YML} -PathType Leaf ) {
Write-Output "$BASE_ENVIRONMENT_YML not found, skipping"
}

$condarc = "C:\Users\Administrator\.condarc"
New-Item $condarc
Set-Content $condarc "channels:"
Add-Content $condarc " - conda-forge"
Add-Content $condarc "channel_alias: http://conda.hic-tre.dundee.ac.uk"
# Internal Conda proxy or repository
if ( $Env:CONDA_PROXY_SERVER ) {
Write-Output "Configuring conda proxy ${Env:CONDA_PROXY_SERVER}"
$condarc = "C:\Users\Administrator\.condarc"
New-Item $condarc
Set-Content $condarc "channels:"
Add-Content $condarc " - conda-forge"
Add-Content $condarc "channel_alias: ${Env:CONDA_PROXY_SERVER}"
}

conda deactivate
17 changes: 12 additions & 5 deletions modules/rstudio.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,21 @@ $RConfig = @"
# Set the default help type
options(help_type="html")

# HIC TRE R Repository
# Set timezone
Sys.setenv(TZ='Europe/London')

"@

# Internal CRAN proxy or repository
if ( $Env:CRAN_PROXY_SERVER ) {
Write-Output "Configuring CRAN proxy ${Env:CRAN_PROXY_SERVER}"
$RConfig += @"
local({r <- getOption("repos")
r["CRAN"] <- "http://cran.hic-tre.dundee.ac.uk/"
r["CRAN"] <- "${Env:CRAN_PROXY_SERVER}"
options(repos=r)
})

# Set timezone
Sys.setenv(TZ='Europe/London')
"@
}

Set-Content "C:\Program Files\R\R-4.4.0\etc\Rprofile.site" $RConfig
Set-Content "C:\Users\Administrator\Documents\.Renviron" "RSTUDIO_DISABLE_SECURE_DOWNLOAD_WARNING=1"
17 changes: 11 additions & 6 deletions modules/rstudio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,21 @@ cat > "$HOME/.Rprofile" <<EOF
# Set the default help type
options(help_type="html")

# HIC TRE R Repository
local({r <- getOption("repos")
r["CRAN"] <- "http://cran.hic-tre.dundee.ac.uk/"
options(repos=r)
})

# Set timezone
Sys.setenv(TZ='Europe/London')
EOF

# Internal CRAN proxy or repository
if [ -n "${CRAN_PROXY_SERVER:-}" ]; then
echo "Configuring CRAN proxy ${CRAN_PROXY_SERVER}"
cat >> "$HOME/.Rprofile" <<EOF
local({r <- getOption("repos")
r["CRAN"] <- "$CRAN_PROXY_SERVER"
options(repos=r)
})
EOF
fi

echo "RSTUDIO_DISABLE_SECURE_DOWNLOAD_WARNING=1" >> "$HOME/.Renviron"

sudo add-apt-repository -y ppa:c2d4u.team/c2d4u4.0+
Expand Down
6 changes: 6 additions & 0 deletions templates/default.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

{% set env = env|default([],true) %}
{% set private_env = private_env|default([],true) %}
{# For example, to configure an internal CRAN and conda proxy/repository:
{% set private_env = [
"CONDA_PROXY_SERVER=http://conda.hic-tre.dundee.ac.uk",
"CRAN_PROXY_SERVER=http://cran.hic-tre.dundee.ac.uk/",
] %}
#}

{% set modules = modules|default([],true) %}
{% set security_modules = security_modules|default([],true) %}
Expand Down