-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sdktechno 237: add chatgpt and copilot to vscode
* add vs code 4.15 --------- Co-authored-by: GitHub Action Bot <[email protected]>
- Loading branch information
1 parent
4274022
commit 409d507
Showing
20 changed files
with
420 additions
and
2 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
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,117 @@ | ||
ARG BASE_CONTAINER | ||
|
||
FROM saagie/python:3.9-1.109.0 AS PYTHON39 | ||
FROM $BASE_CONTAINER | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -qqy --no-install-recommends \ | ||
wget \ | ||
gcc \ | ||
g++ \ | ||
libsasl2-2 \ | ||
libsasl2-modules-ldap \ | ||
build-essential \ | ||
unixodbc \ | ||
unixodbc-dev \ | ||
libpq-dev \ | ||
libsqlite3-dev \ | ||
libkrb5-dev \ | ||
libsasl2-dev \ | ||
libssl-dev \ | ||
libcurl4-openssl-dev \ | ||
libgeos-dev \ | ||
swig \ | ||
python3-matplotlib \ | ||
python3-lxml \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/ | ||
|
||
ARG NB_UID="1000" | ||
ARG NB_GID="100" | ||
|
||
ENV CONDA_DIR=/opt/conda \ | ||
SHELL=/bin/bash \ | ||
NB_UID=${NB_UID} \ | ||
NB_GID=${NB_GID} \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US.UTF-8 | ||
ENV PATH="${CONDA_DIR}/bin:${PATH}" | ||
|
||
# Install miniforge | ||
ARG CONDA_MIRROR=https://github.com/conda-forge/miniforge/releases/latest/download | ||
|
||
# ---- Miniforge installer ---- | ||
# Check https://github.com/conda-forge/miniforge/releases | ||
# Package Manager and Python implementation to use (https://github.com/conda-forge/miniforge) | ||
# We're using Mambaforge installer, possible options: | ||
# - conda only: either Miniforge3 to use Python or Miniforge-pypy3 to use PyPy | ||
# - conda + mamba: either Mambaforge to use Python or Mambaforge-pypy3 to use PyPy | ||
# Installation: conda, mamba, pip | ||
RUN set -x && \ | ||
# Miniforge installer | ||
miniforge_arch=$(uname -m) && \ | ||
miniforge_installer="Mambaforge-Linux-${miniforge_arch}.sh" && \ | ||
wget --quiet "${CONDA_MIRROR}/${miniforge_installer}" && \ | ||
/bin/bash "${miniforge_installer}" -f -b -p "${CONDA_DIR}" && \ | ||
rm "${miniforge_installer}" && \ | ||
# Conda configuration see https://conda.io/projects/conda/en/latest/configuration.html | ||
conda config --system --set auto_update_conda false && \ | ||
conda config --system --set show_channel_urls true && \ | ||
if [[ "${PYTHON_VERSION}" != "default" ]]; then mamba install --quiet --yes python="${PYTHON_VERSION}"; fi && \ | ||
# Pin major.minor version of python | ||
mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" && \ | ||
# Using conda to update all packages: https://github.com/mamba-org/mamba/issues/1092 | ||
conda update --all --quiet --yes && \ | ||
conda clean --all -f -y && \ | ||
fix-permissions "${CONDA_DIR}" | ||
|
||
# Create 3 conda envs | ||
RUN conda create -n py38 python=3.8.12 \ | ||
&& bash -c "source activate py38 && conda install notebook ipykernel -y && ipython kernel install --user --name py38 --display-name 'Python 3.8'" \ | ||
&& conda create -n py39 python=3.9.10 \ | ||
&& bash -c "source activate py39 && conda install notebook ipykernel -y && ipython kernel install --user --name py39 --display-name 'Python 3.9'" \ | ||
&& conda create -n py310 python=3.10.2 \ | ||
&& bash -c "source activate py310 && conda install notebook ipykernel -y && ipython kernel install --user --name py310 --display-name 'Python 3.10'" \ | ||
&& conda clean -ay \ | ||
&& rm -rf ~/.cache/pip \ | ||
&& fix-permissions "${CONDA_DIR}" | ||
|
||
# Get requirements from Saagie Python image | ||
COPY --from=PYTHON39 /tmp/requirements.txt /tmp/requirements.txt | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Install requirements from Saagie Python image | ||
RUN sh -x \ | ||
&& for env in py38 py39 py310; \ | ||
do \ | ||
. activate $env \ | ||
&& python -m pip install --no-cache-dir -r /tmp/requirements.txt \ | ||
&& conda deactivate; \ | ||
done \ | ||
&& conda clean -ay \ | ||
&& rm -rf ~/.cache/pip \ | ||
&& fix-permissions "${CONDA_DIR}" | ||
|
||
|
||
# Install Vscode Python extension | ||
COPY extensions/* /tmp/extensions/ | ||
RUN /app/code-server/bin/code-server --extensions-dir /config/extensions/ --install-extension ms-python.python | ||
RUN /app/code-server/bin/code-server --extensions-dir /config/extensions/ --install-extension genieai.chatgpt-vscode | ||
RUN /app/code-server/bin/code-server --extensions-dir /config/extensions/ --install-extension /tmp/extensions/GitHub.copilot-1.99.290.vsix | ||
|
||
# # # Change settings to run interactive code in jupyter | ||
# COPY resources/* /config/data/User/ | ||
RUN rm /tmp/settings/settings.json | ||
COPY resources/* /tmp/settings/ | ||
|
||
ENV CONDA_DEFAULT_ENV=py310 | ||
|
||
# Setup user env and prefix environment variables with VSCODE_ | ||
RUN conda init bash \ | ||
&& echo "conda activate py310" >> ~/.bashrc \ | ||
&& sed -i '2s|^|\ | ||
mkdir -p /config/workspace/.vscode \n \ | ||
cp -u /tmp/settings/project-settings.json /config/workspace/.vscode/settings.json \n \ | ||
|' /etc/s6-overlay/s6-rc.d/svc-code-server/run |
35 changes: 35 additions & 0 deletions
35
technologies/app/vscode/vscode-4.15-python/build.gradle.kts
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 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2019-2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import com.bmuschko.gradle.docker.DockerRemoteApiPlugin | ||
import com.saagie.technologies.SaagieTechnologiesGradlePlugin | ||
import com.saagie.technologies.readDockerInfo | ||
import com.saagie.technologies.getVersionForDocker | ||
|
||
|
||
apply<DockerRemoteApiPlugin>() | ||
apply<SaagieTechnologiesGradlePlugin>() | ||
|
||
val dockerInfo = readDockerInfo(projectDir) | ||
|
||
tasks.withType(com.bmuschko.gradle.docker.tasks.image.DockerBuildImage::class) { | ||
dependsOn(":vscode-4.15:testImage") | ||
this.buildArgs.put( | ||
"BASE_CONTAINER", | ||
"${dockerInfo?.image}:4.15.0-${this.project.getVersionForDocker()}" | ||
) | ||
} |
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,11 @@ | ||
id: vscode-python-4.15.0 | ||
label: VS Code Python 4.15.0 | ||
releaseNotes: "" | ||
available: true | ||
trustLevel: experimental | ||
ports: | ||
- port: 80 | ||
name: vscode | ||
rewriteUrl: false | ||
basePath: SAAGIE_BASE_PATH | ||
volumes: ["/config/workspace", "/config/data/User"] |
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,4 @@ | ||
image: saagie/vscode-server | ||
baseTag: python-4.15.0 | ||
dynamicVersion: 1.163.0_SDKTECHNO-237 | ||
version: python-4.15.0-1.163.0_SDKTECHNO-237 |
Binary file added
BIN
+7.94 MB
technologies/app/vscode/vscode-4.15-python/extensions/GitHub.copilot-1.99.290.vsix
Binary file not shown.
28 changes: 28 additions & 0 deletions
28
technologies/app/vscode/vscode-4.15-python/image_test.yaml
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,28 @@ | ||
schemaVersion: "2.0.0" | ||
|
||
metadataTest: | ||
env: | ||
- key: LANG | ||
value: "en_US.UTF-8" | ||
- key: LC_ALL | ||
value: "en_US.UTF-8" | ||
- key: CONDA_DIR | ||
value: "/opt/conda" | ||
|
||
fileExistenceTests: | ||
- name: "entrypoint" | ||
path: "/entrypoint.sh" | ||
shouldExist: true | ||
permissions: "-rwxr-xr-x" | ||
- name: "vs code nginx" | ||
path: "/etc/nginx/sites-enabled/nginx.conf" | ||
shouldExist: true | ||
- name: " No default nginx conf" | ||
path: /etc/nginx/sites-enabled/default | ||
shouldExist: false | ||
|
||
commandTests: | ||
- name: "python installation" | ||
command: "which" | ||
args: [ "python" ] | ||
expectedOutput: [ "/opt/conda/bin/python" ] |
3 changes: 3 additions & 0 deletions
3
technologies/app/vscode/vscode-4.15-python/resources/project-settings.json
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,3 @@ | ||
{ | ||
"python.defaultInterpreterPath": "/opt/conda/envs/py310/bin/python" | ||
} |
7 changes: 7 additions & 0 deletions
7
technologies/app/vscode/vscode-4.15-python/resources/settings.json
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,7 @@ | ||
{ | ||
"jupyter.sendSelectionToInteractiveWindow": true, | ||
"jupyter.alwaysScrollOnNewCell": true, | ||
"jupyter.askForKernelRestart": false, | ||
"interactiveWindow.collapseCellInputCode": "never", | ||
"workbench.colorTheme": "Default Dark+" | ||
} |
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,42 @@ | ||
FROM ghcr.io/linuxserver/code-server:4.15.0 | ||
|
||
USER root | ||
|
||
ENV PUID=1000 | ||
ENV PGID=1000 | ||
RUN TZ=Europe/London | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y nginx \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/ \ | ||
&& rm /etc/nginx/sites-enabled/default | ||
|
||
COPY resources/nginx.conf /etc/nginx/sites-enabled/nginx.conf | ||
COPY resources/entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh \ | ||
&& chmod +x /etc/nginx/sites-enabled/nginx.conf | ||
|
||
# Copy a script that we will use to correct permissions after running certain commands | ||
COPY resources/fix-permissions /usr/local/bin/fix-permissions | ||
RUN chmod a+rx /usr/local/bin/fix-permissions | ||
|
||
RUN mkdir -p /tmp/settings | ||
COPY resources/settings.json /tmp/settings/ | ||
|
||
RUN sed -i 's/SUDO_PASSWORD/VSCODE_SUDO_PASSWORD/g' /etc/s6-overlay/s6-rc.d/init-code-server/run \ | ||
&& sed -i '2s|^|\ | ||
export PASSWORD=$VSCODE_PASSWORD \n \ | ||
export HASHED_PASSWORD=$VSCODE_HASHED_PASSWORD \n \ | ||
mkdir -p /config/data/User/ \n \ | ||
cp -u /tmp/settings/settings.json /config/data/User/ \n \ | ||
fix-permissions /config/ \n \ | ||
|' /etc/s6-overlay/s6-rc.d/svc-code-server/run | ||
|
||
COPY resources/nginx-run /etc/services.d/nginx/run | ||
|
||
EXPOSE 8443 | ||
|
||
# Use s6-overlay as entrypoint to run multiple processes | ||
ENTRYPOINT ["/init"] |
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,22 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* Copyright 2019-2021. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import com.bmuschko.gradle.docker.DockerRemoteApiPlugin | ||
import com.saagie.technologies.SaagieTechnologiesGradlePlugin | ||
|
||
apply<DockerRemoteApiPlugin>() | ||
apply<SaagieTechnologiesGradlePlugin>() |
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,11 @@ | ||
id: vscode-4.15.0 | ||
label: VS Code 4.15.0 | ||
releaseNotes: "" | ||
available: true | ||
trustLevel: experimental | ||
ports: | ||
- port: 80 | ||
name: vscode | ||
rewriteUrl: false | ||
basePath: SAAGIE_BASE_PATH | ||
volumes: ["/config/workspace", "/config/data/User"] |
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,4 @@ | ||
image: saagie/vscode-server | ||
baseTag: 4.15.0 | ||
dynamicVersion: 1.163.0_SDKTECHNO-237 | ||
version: 4.15.0-1.163.0_SDKTECHNO-237 |
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 @@ | ||
schemaVersion: "2.0.0" | ||
|
||
fileExistenceTests: | ||
- name: "entrypoint" | ||
path: "/entrypoint.sh" | ||
shouldExist: true | ||
permissions: "-rwxr-xr-x" | ||
- name: "vs code nginx" | ||
path: "/etc/nginx/sites-enabled/nginx.conf" | ||
shouldExist: true | ||
- name: " No default nginx conf" | ||
path: /etc/nginx/sites-enabled/default | ||
shouldExist: false |
14 changes: 14 additions & 0 deletions
14
technologies/app/vscode/vscode-4.15/resources/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,14 @@ | ||
#!/bin/bash | ||
echo "Set Proxy" | ||
export PROXY_DOMAIN=$SAAGIE_BASE_PATH | ||
|
||
echo "SAAGIE_BASE_PATH" | ||
echo $SAAGIE_BASE_PATH | ||
echo "PROXY_DOMAIN" | ||
echo $PROXY_DOMAIN | ||
|
||
# /init | ||
|
||
sed -i 's:SAAGIE_BASE_PATH:'"$SAAGIE_BASE_PATH"':g' /etc/nginx/sites-enabled/nginx.conf | ||
|
||
/init |
Oops, something went wrong.