From 2c304c8466fb0d2b14fc4507b52a7293b40a2a67 Mon Sep 17 00:00:00 2001 From: svor Date: Fri, 24 Sep 2021 16:13:05 +0300 Subject: [PATCH 1/2] feat(devfile): introduce a devfile version 2 Signed-off-by: svor --- .vscode/extensions.json | 7 +++++++ .vscode/launch.json | 14 ++++++++++++++ devfile.yaml | 24 ++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 .vscode/extensions.json create mode 100644 .vscode/launch.json create mode 100644 devfile.yaml diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..339f4f6 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "ms-python.python" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..4f2529f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "${file}", + "console": "internalConsole" + } + ] + } diff --git a/devfile.yaml b/devfile.yaml new file mode 100644 index 0000000..63ee08d --- /dev/null +++ b/devfile.yaml @@ -0,0 +1,24 @@ +schemaVersion: 2.1.0 +metadata: + name: python-hello-world +components: + - name: python + container: + image: quay.io/eclipse/che-python-3.8:next + volumeMounts: + - name: venv + path: /home/user/.venv + memoryLimit: 512Mi + mountSources: true + - name: venv + volume: + size: 1G +commands: + - id: run + exec: + label: "Run the application" + component: python + workingDir: ${PROJECTS_ROOT}/python-hello-world + commandLine: ". ${HOME}/.venv/bin/activate && python hello-world.py" + group: + kind: run From 137d07e193f5b493d9a9c4910a73f801360dcbe0 Mon Sep 17 00:00:00 2001 From: svor Date: Mon, 27 Sep 2021 14:18:04 +0300 Subject: [PATCH 2/2] fix: use universal image as an user image Signed-off-by: svor --- devfile.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devfile.yaml b/devfile.yaml index 63ee08d..d638371 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -1,10 +1,12 @@ schemaVersion: 2.1.0 metadata: name: python-hello-world +attributes: + che-theia.eclipse.org/sidecar-policy: USE_DEV_CONTAINER components: - name: python container: - image: quay.io/eclipse/che-python-3.8:next + image: quay.io/devfile/base-developer-image:ubi8-7bd4fe3 volumeMounts: - name: venv path: /home/user/.venv @@ -19,6 +21,6 @@ commands: label: "Run the application" component: python workingDir: ${PROJECTS_ROOT}/python-hello-world - commandLine: ". ${HOME}/.venv/bin/activate && python hello-world.py" + commandLine: "python3 hello-world.py" group: kind: run