From 4baa758fe541819b96c78126a82de02c906f6480 Mon Sep 17 00:00:00 2001 From: Dylan Decrulle <81740200+ddecrulle@users.noreply.github.com> Date: Thu, 11 Jun 2026 15:40:28 +0200 Subject: [PATCH 1/2] feat: add opencode to IDE images and OpenAI env vars in init script - export OPENAI_API_KEY and OPENAI_BASE_URL in onyxia-init.sh - install opencode in vscode, rstudio and jupyter images Co-Authored-By: Claude Fable 5 --- base/scripts/install-opencode.sh | 9 +++++++++ base/scripts/onyxia-init.sh | 9 +++++++++ jupyter/Dockerfile | 2 ++ jupyter/tests.yaml | 4 ++++ rstudio/Dockerfile | 2 ++ rstudio/tests.yaml | 4 ++++ vscode/Dockerfile | 2 ++ vscode/tests.yaml | 4 ++++ 8 files changed, 36 insertions(+) create mode 100644 base/scripts/install-opencode.sh diff --git a/base/scripts/install-opencode.sh b/base/scripts/install-opencode.sh new file mode 100644 index 00000000..6d06db2b --- /dev/null +++ b/base/scripts/install-opencode.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -e + +# Install opencode using the official installer +curl -fsSL https://opencode.ai/install | bash -s -- --no-modify-path + +# Make opencode available system-wide +mv ${HOME}/.opencode/bin/opencode /usr/local/bin/opencode +rm -rf ${HOME}/.opencode diff --git a/base/scripts/onyxia-init.sh b/base/scripts/onyxia-init.sh index ad5b6fe3..42ea7cc3 100755 --- a/base/scripts/onyxia-init.sh +++ b/base/scripts/onyxia-init.sh @@ -232,6 +232,15 @@ if command -v R >/dev/null 2>&1; then fi fi + +# Configure OpenAI credentials +if [[ -n "$OPENAI_API_KEY" ]]; then + echo "export OPENAI_API_KEY=\"$OPENAI_API_KEY\"" >> ${HOME}/.bashrc +fi +if [[ -n "$OPENAI_BASE_URL" ]]; then + echo "export OPENAI_BASE_URL=\"$OPENAI_BASE_URL\"" >> ${HOME}/.bashrc +fi + # The commands related to setting the various repositories (R/CRAN, pip) # are located in specific script source /opt/onyxia-set-repositories.sh diff --git a/jupyter/Dockerfile b/jupyter/Dockerfile index 80fb733e..32a0edf1 100644 --- a/jupyter/Dockerfile +++ b/jupyter/Dockerfile @@ -21,6 +21,8 @@ RUN /opt/install-jupyterlab.sh && \ # Generate jupyter server config jupyter server --generate-config && \ jupyter lab clean && \ + # Install opencode + /opt/install-opencode.sh && \ # Fix user permissions /opt/fix-user-permissions.sh && \ # Clean diff --git a/jupyter/tests.yaml b/jupyter/tests.yaml index e39f6846..e6b98b25 100644 --- a/jupyter/tests.yaml +++ b/jupyter/tests.yaml @@ -45,3 +45,7 @@ commandTests: command: "which" args: ["duckdb"] expectedOutput: ["/usr/local/bin/duckdb"] + - name: "Does the binary exists?" + command: "which" + args: ["opencode"] + expectedOutput: ["/usr/local/bin/opencode"] diff --git a/rstudio/Dockerfile b/rstudio/Dockerfile index a472ece9..dbcb0cc9 100644 --- a/rstudio/Dockerfile +++ b/rstudio/Dockerfile @@ -17,6 +17,8 @@ COPY --chmod=0755 scripts/ /opt/ RUN /rocker_scripts/install_rstudio.sh && \ /rocker_scripts/install_pandoc.sh && \ /opt/configure-rstudio.sh && \ + # Install opencode + /opt/install-opencode.sh && \ # Fix user permissions /opt/fix-user-permissions.sh && \ # Clean diff --git a/rstudio/tests.yaml b/rstudio/tests.yaml index 04035354..96a4d01d 100644 --- a/rstudio/tests.yaml +++ b/rstudio/tests.yaml @@ -41,3 +41,7 @@ commandTests: command: "which" args: ["duckdb"] expectedOutput: ["/usr/local/bin/duckdb"] + - name: "Does the binary exists?" + command: "which" + args: ["opencode"] + expectedOutput: ["/usr/local/bin/opencode"] diff --git a/vscode/Dockerfile b/vscode/Dockerfile index d6d8d58a..5551c336 100644 --- a/vscode/Dockerfile +++ b/vscode/Dockerfile @@ -15,6 +15,8 @@ COPY --chown=${USERNAME}:${GROUPNAME} settings/Remote.json ${REMOTE_CONFIG_DIR}/ # Install VSCode RUN /opt/install-vscode.sh && \ /opt/install-vscode-extensions.sh && \ + # Install opencode + /opt/install-opencode.sh && \ # Fix user permissions /opt/fix-user-permissions.sh && \ # Clean diff --git a/vscode/tests.yaml b/vscode/tests.yaml index fa33d031..32e0c832 100644 --- a/vscode/tests.yaml +++ b/vscode/tests.yaml @@ -37,3 +37,7 @@ commandTests: command: "which" args: ["duckdb"] expectedOutput: ["/usr/local/bin/duckdb"] + - name: "Does the binary exists?" + command: "which" + args: ["opencode"] + expectedOutput: ["/usr/local/bin/opencode"] From 8f0b73422321619f1a8133df211112f032277b44 Mon Sep 17 00:00:00 2001 From: Dylan Decrulle Date: Tue, 16 Jun 2026 15:00:58 +0200 Subject: [PATCH 2/2] Remove OpenAI credentials setup Removed OpenAI credentials configuration from onyxia-init.sh. --- base/scripts/onyxia-init.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/base/scripts/onyxia-init.sh b/base/scripts/onyxia-init.sh index 42ea7cc3..37b708fe 100755 --- a/base/scripts/onyxia-init.sh +++ b/base/scripts/onyxia-init.sh @@ -233,14 +233,6 @@ if command -v R >/dev/null 2>&1; then fi -# Configure OpenAI credentials -if [[ -n "$OPENAI_API_KEY" ]]; then - echo "export OPENAI_API_KEY=\"$OPENAI_API_KEY\"" >> ${HOME}/.bashrc -fi -if [[ -n "$OPENAI_BASE_URL" ]]; then - echo "export OPENAI_BASE_URL=\"$OPENAI_BASE_URL\"" >> ${HOME}/.bashrc -fi - # The commands related to setting the various repositories (R/CRAN, pip) # are located in specific script source /opt/onyxia-set-repositories.sh