-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
152 additions
and
0 deletions.
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Build docker | ||
on: | ||
workflow_call: | ||
inputs: | ||
context: | ||
type: string | ||
required: true | ||
workload_identity_provider: | ||
type: string | ||
required: false | ||
default: "projects/1095590792109/locations/global/workloadIdentityPools/github-actions/providers/github" | ||
service_account: | ||
type: string | ||
required: false | ||
default: "[email protected]" | ||
|
||
|
||
# Required by gcloud auth | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Authenticate to Google Cloud | ||
id: auth | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
token_format: 'access_token' | ||
workload_identity_provider: ${{ inputs.workload_identity_provider }} | ||
service_account: ${{ inputs.service_account }} | ||
|
||
- name: Login to GCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: gcr.io | ||
username: oauth2accesstoken | ||
password: ${{ steps.auth.outputs.access_token }} | ||
|
||
- name: Extract metadata for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: gcr.io/instruqt/vscode | ||
tags: | | ||
type=semver,pattern={{version}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: vscode | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outpu |
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,13 @@ | ||
name: Build and Release | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
vscode: | ||
build-docker: | ||
uses: instruqt/lab-agent/.github/workflows/docker.yml@main | ||
with: | ||
context: vscode | ||
secrets: inherit |
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,23 @@ | ||
FROM codercom/code-server:4.95.3-debian | ||
|
||
RUN sudo apt update && sudo apt install -y \ | ||
curl wget zip git jq build-essential software-properties-common fonts-jetbrains-mono | ||
|
||
ARG EXTENSIONS="" | ||
ENV EXTENSIONS=${EXTENSIONS} | ||
|
||
COPY files/install_dependencies.sh /install_dependencies.sh | ||
RUN sudo chmod +x /install_dependencies.sh ; /install_dependencies.sh | ||
|
||
COPY files/settings.json /home/coder/.local/share/code-server/Machine/settings.json | ||
COPY files/config.yaml /home/coder/.config/code-server/config.yaml | ||
|
||
ENV DEFAULT_FOLDER="/home/coder" | ||
|
||
COPY files/entrypoint.sh /entrypoint.sh | ||
RUN sudo chmod +x /entrypoint.sh | ||
|
||
RUN sudo chown -R coder:coder /home/coder/.local/share/code-server | ||
RUN mkdir -p /home/coder/.local/share/code-server/coder-logs | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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,9 @@ | ||
bind-addr: 127.0.0.1:8080 | ||
auth: none | ||
cert: false | ||
disable-telemetry: true | ||
disable-update-check: true | ||
disable-workspace-trust: true | ||
disable-getting-started-override: true | ||
ignore-last-opened: true | ||
app-name: instruqt |
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,2 @@ | ||
#!/bin/bash | ||
code-server --bind-addr="0.0.0.0:8000" --disable-workspace-trust ${DEFAULT_FOLDER} |
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,20 @@ | ||
#!/bin/bash -ex | ||
|
||
for extension in ${EXTENSIONS//,/$IFS}; do | ||
OUTPUT=$(code-server --install-extension $extension) | ||
if [[ ! ${OUTPUT} =~ 'successfully installed' ]]; then | ||
echo "fallback" | ||
AUTHOR=$(echo $extension | cut -d '.' -f 1) | ||
PACKAGE=$(echo $extension | cut -d '.' -f 2 | cut -d '@' -f 1) | ||
VERSION=$(echo $extension | cut -d '@' -f 2) | ||
curl -L --retry 5 -o extension.gz https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${AUTHOR}/vsextensions/${PACKAGE}/${VERSION}/vspackage | ||
gunzip extension.gz | ||
mv extension extension.vsix | ||
RETRY=$(code-server --install-extension extension.vsix) | ||
rm extension.vsix | ||
if [[ ! ${RETRY} =~ 'successfully installed' ]]; then | ||
echo "could not install package" | ||
exit 1 | ||
fi | ||
fi | ||
done |
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,21 @@ | ||
{ | ||
"workbench.startupEditor": "none", | ||
"workbench.colorTheme": "Visual Studio Dark", | ||
"explorer.confirmDragAndDrop": false, | ||
"editor.minimap.enabled": false, | ||
"vsonline.accountProvider": "Microsoft", | ||
"codespaces.accountProvider": "Microsoft", | ||
"editor.scrollBeyondLastLine": false, | ||
"liveshare.authenticationProvider": "GitHub", | ||
"editor.tabSize": 4, | ||
"terminal.integrated.fontFamily": "JetBrains Mono", | ||
"workbench.editorAssociations": { | ||
}, | ||
"terminal.explorerKind": "external", | ||
"security.workspace.trust.untrustedFiles": "open", | ||
"editor.suggestSelection": "first", | ||
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue", | ||
"terminal.integrated.tabs.enabled": false, | ||
"git.ignoreRebaseWarning": true, | ||
"editor.accessibilitySupport": "off" | ||
} |