-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: run-image for buildpacks with vscodium and python #485
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4fa22dc
exp: run-image for python builds
leafty 0bb5c96
update
leafty 253211f
revert changes from main
leafty 8dcd19c
add workflow
leafty a9e32e1
fix build
leafty cf0ff6a
fix lint
leafty 5f9102b
do some renaming
leafty 307a035
oopsiiiie >~<"
leafty becd1ee
Fix in lint step
leafty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ jobs: | |
- docker/vscode/conda.Dockerfile | ||
- docker/vscode/poetry.Dockerfile | ||
- docker/vscode/R.Dockerfile | ||
- docker/vscodium-buildpacks/base.Dockerfile | ||
leafty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -928,3 +929,48 @@ jobs: | |
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
provenance: false | ||
|
||
build-vscodium-python-runimage: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- BASE_IMAGE: ubuntu:24.04 | ||
BASE_IMAGE_TAG: ubuntu | ||
LATEST: true | ||
steps: | ||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.RENKU_DOCKER_USERNAME }} | ||
password: ${{ secrets.RENKU_DOCKER_PASSWORD }} | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.DOCKER_PREFIX }}-vscodium-python-runimage | ||
tags: | | ||
type=sha,prefix=${{ matrix.BASE_IMAGE_TAG }}- | ||
type=semver,pattern={{version}},prefix=${{ matrix.BASE_IMAGE_TAG }}- | ||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' && matrix.LATEST }} | ||
- name: Build and export | ||
uses: docker/build-push-action@v6 | ||
with: | ||
build-args: | | ||
BASE_IMAGE=${{ matrix.BASE_IMAGE }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
context: docker/vscodium-runimage | ||
file: docker/vscodium-runimage/python.Dockerfile | ||
labels: ${{ steps.meta.outputs.labels }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
provenance: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
set -ex | ||
|
||
HOME="${HOME:-/home/ubuntu}" | ||
RENKU_MOUNT_DIR="${RENKU_MOUNT_DIR:-${HOME}/work}" | ||
|
||
mkdir -p "${RENKU_MOUNT_DIR}/.vscode/extensions" | ||
|
||
# Install python extensions | ||
DEFAULT_VSCODIUM_EXTENSIONS="\ | ||
ms-python.python \ | ||
ms-toolsai.jupyter \ | ||
" | ||
VSCODIUM_EXTENSIONS="${VSCODIUM_EXTENSIONS:-${DEFAULT_VSCODIUM_EXTENSIONS}}" | ||
VSCODIUM_EXTENSIONS=($VSCODIUM_EXTENSIONS) | ||
for ext in "${VSCODIUM_EXTENSIONS[@]}"; do | ||
/codium-server/bin/codium-server \ | ||
--extensions-dir "${RENKU_MOUNT_DIR}/.vscode/extensions" \ | ||
--server-data-dir "${RENKU_MOUNT_DIR}/.vscode" \ | ||
--install-extension "${ext}" || true | ||
done | ||
|
||
RENKU_WORKING_DIR="${RENKU_WORKING_DIR:-${RENKU_MOUNT_DIR}}" | ||
|
||
RENKU_BASE_URL_PATH="${RENKU_BASE_URL_PATH:-/}" | ||
if [[ "${RENKU_BASE_URL_PATH}" != */ ]]; then | ||
RENKU_BASE_URL_PATH="${RENKU_BASE_URL_PATH}/" | ||
fi | ||
|
||
RENKU_SESSION_IP="${RENKU_SESSION_IP:-0.0.0.0}" | ||
RENKU_SESSION_PORT="${RENKU_SESSION_PORT:-8888}" | ||
|
||
/codium-server/bin/codium-server \ | ||
--server-base-path "${RENKU_BASE_URL_PATH}" \ | ||
--host "${RENKU_SESSION_IP}" \ | ||
--port "${RENKU_SESSION_PORT}" \ | ||
--extensions-dir "${RENKU_MOUNT_DIR}/.vscode/extensions" \ | ||
--server-data-dir "${RENKU_MOUNT_DIR}/.vscode" \ | ||
--without-connection-token \ | ||
--accept-server-license-terms \ | ||
--telemetry-level off \ | ||
--default-folder "${RENKU_WORKING_DIR}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ARG BASE_IMAGE=ubuntu:24.04 | ||
FROM $BASE_IMAGE | ||
ARG VSCODIUM_VERSION=1.96.4.25026 | ||
SHELL [ "/bin/bash", "-c", "-o", "pipefail" ] | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
git \ | ||
git-lfs \ | ||
libbz2-dev \ | ||
libffi-dev \ | ||
liblzma-dev \ | ||
libncursesw5-dev \ | ||
libreadline-dev \ | ||
libsqlite3-dev \ | ||
libssl-dev \ | ||
libxml2-dev \ | ||
libxmlsec1-dev \ | ||
tk-dev \ | ||
xz-utils \ | ||
zlib1g-dev \ | ||
&& \ | ||
mkdir -p /codium-server && \ | ||
curl -L https://github.com/VSCodium/vscodium/releases/download/${VSCODIUM_VERSION}/vscodium-reh-web-linux-x64-${VSCODIUM_VERSION}.tar.gz | tar -xz -C /codium-server && \ | ||
rm -rf /var/lib/apt/lists/* | ||
ENV LANG=C.UTF-8 | ||
ENV LC_ALL=C.UTF-8 | ||
USER ubuntu | ||
WORKDIR /home/ubuntu | ||
|
||
COPY --chown=root:root --chmod=755 entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT [ "/entrypoint.sh" ] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should we call this
vscodium-runimage
? Orvscodium-buildpacks-runimage
? It's not a buildpack