Skip to content

Commit c89ed1d

Browse files
authored
testing for positron
1 parent e167ab4 commit c89ed1d

File tree

2 files changed

+124
-0
lines changed

2 files changed

+124
-0
lines changed

positron_rocky/Singularity

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
Bootstrap: docker
2+
From: rockylinux/rockylinux:9
3+
4+
# perl-CPAN cpan install LSF::Base LSF::Batch
5+
6+
%post
7+
NODE_VERSION=24.7.0
8+
EZA_VERSION=0.23.2
9+
QUARTO_VERSION=1.7.34
10+
POSITRON_VERSION=2025.09.0-139
11+
12+
# Install necessary dependencies
13+
dnf install -y --allowerasing \
14+
dnf-plugins-core wget curl openssh-clients zsh gzip bzip2 xz git which \
15+
libnsl libxcrypt-compat acl epel-release git diffutils iputils \
16+
zip unzip traceroute bind-utils net-tools procps-ng lsof file gsl gsl-devel
17+
18+
## Rocky 9 only ##
19+
dnf config-manager --set-enabled crb
20+
/bin/crb enable
21+
# dnf -y localinstall "https://pkgs.dyn.su/el9/base/x86_64/raven-release.el9.noarch.rpm" #for compat-openssl10
22+
dnf clean all && dnf update -y
23+
## end Rocky 9 only ##
24+
25+
dnf install -y Lmod lua-devel fish && \
26+
dnf clean all && \
27+
rm -rf /var/cache/dnf # compat-openssl10 eza
28+
wget https://github.com/eza-community/eza/releases/download/v${EZA_VERSION}/eza_x86_64-unknown-linux-gnu.tar.gz
29+
tar xf eza_x86_64-unknown-linux-gnu.tar.gz
30+
rm eza_x86_64-unknown-linux-gnu.tar.gz
31+
mv eza /usr/local/bin/eza
32+
ln -s $(which eza) /usr/local/bin/exa
33+
34+
# Install Conda
35+
36+
wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" && \
37+
bash Miniforge3.sh -b -p /opt/conda && \
38+
rm Miniforge3.sh && \
39+
echo "done"
40+
41+
# Install Positron
42+
43+
wget -O positron.rpm "https://cdn.posit.co/positron/releases/rpm/x86_64/Positron-${POSITRON_VERSION}-x64.rpm" && \
44+
rpm -iv positron.rpm && \
45+
rm positron.rpm
46+
47+
# install node
48+
49+
curl -fsSL https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz | \
50+
tar -xJ -C /usr/local --strip-components=1 && \
51+
ln -s /usr/local/bin/node /usr/bin/node && \
52+
ln -s /usr/local/bin/npm /usr/bin/npm && \
53+
ln -s /usr/local/bin/npx /usr/bin/npx
54+
55+
# Install quarto
56+
57+
curl -fsSL -o quarto.tar.gz \
58+
https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz && \
59+
mkdir -p /opt/quarto && \
60+
tar -xzf quarto.tar.gz -C /opt/quarto --strip-components=1 && \
61+
ln -s /opt/quarto/bin/quarto /usr/local/bin/quarto && \
62+
rm quarto.tar.gz
63+
64+
%files
65+
vscode_rocky/start_code.sh /opt/start_code.sh
66+
67+
%environment
68+
export S_CONDAENV=${S_CONDAENV:-$CONDA_DEFAULT_ENV}
69+
[[ -z "$http_proxy" ]] || export http_proxy=$http_proxy
70+
[[ -z "$https_proxy" ]] || export https_proxy=$https_proxy
71+
[[ -z "$no_proxy" ]] || export no_proxy=$no_proxy
72+
[[ -z "$ftp_proxy" ]] || export ftp_proxy=$ftp_proxy
73+
[[ -z "$all_proxy" ]] || export all_proxy=$all_proxy
74+
[[ -z "$rsync_proxy" ]] || export rsync_proxy=$rsync_proxy
75+
76+
%apprun code
77+
bash /opt/start_positron.sh "${@}"
78+
79+
%apprun bash
80+
#!/bin/bash
81+
. /opt/conda/etc/profile.d/conda.sh && \
82+
. /opt/conda/etc/profile.d/mamba.sh && \
83+
alias ll='ls -l' && \
84+
echo "activating env $RS_CONDAENV" && \
85+
conda activate $RS_CONDAENV && \
86+
echo "starting BASH" && \
87+
/bin/bash
88+
89+
%runscript
90+
#!/bin/bash
91+
bash /opt/start_positron.sh "${@}"

positron_rocky/start_positron.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
# Activate conda and mamba
4+
5+
__conda_setup="$('/opt/conda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
6+
if [ $? -eq 0 ]; then
7+
eval "$__conda_setup"
8+
else
9+
if [ -f "/opt/conda/etc/profile.d/conda.sh" ]; then
10+
. "/opt/conda/etc/profile.d/conda.sh"
11+
else
12+
export PATH="/opt/conda/bin:$PATH"
13+
fi
14+
fi
15+
unset __conda_setup
16+
17+
if [ -f "/opt/conda/etc/profile.d/mamba.sh" ]; then
18+
. "/opt/conda/etc/profile.d/mamba.sh"
19+
fi
20+
21+
# Activate the conda environment
22+
23+
deactcount=0
24+
while [[ -n "$CONDA_PREFIX" && $deactcount -lt 5 ]]; do
25+
conda deactivate
26+
((deactcount+=1))
27+
done
28+
29+
conda activate $RS_CONDAENV
30+
31+
# start vscode
32+
33+
exec code "${@}"

0 commit comments

Comments
 (0)