From bbe2cf02faea4d405842a78eb0a1ffea80a0bede Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Thu, 8 Jun 2023 12:35:12 +0000 Subject: [PATCH 1/7] feat: add devfile and vscode settings to the repo Signed-off-by: Mykhailo Kuznietsov --- .vscode/extensions.json | 6 ++++++ .vscode/launch.json | 11 +++++++++++ devfile.yaml | 16 ++++++++++++++++ 3 files changed, 33 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 0000000000..3c23c868ef --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "rogalmic.bash-debug", + "redhat.vscode-yaml" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..8e9a9a5a68 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,11 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "bashdb", + "request": "launch", + "name": "Bash-Debug (simplest configuration)", + "program": "${file}" + } + ] +} \ No newline at end of file diff --git a/devfile.yaml b/devfile.yaml new file mode 100644 index 0000000000..dcd36056af --- /dev/null +++ b/devfile.yaml @@ -0,0 +1,16 @@ +# +# Copyright (c) 2019-2021 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# +schemaVersion: 2.2.0 +metadata: + name: devspaces-images +# add components:, unless basic udi component is good enough? +# add commands: for building all of the containers? From 1b93874e48eb36fc288626a8cc1d3d8fe7f735aa Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Thu, 8 Jun 2023 14:54:29 +0000 Subject: [PATCH 2/7] fixup! feat: add devfile and vscode settings to the repo --- .vscode/extensions.json | 2 +- .vscode/launch.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3c23c868ef..814f18a15a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,4 +3,4 @@ "rogalmic.bash-debug", "redhat.vscode-yaml" ] -} \ No newline at end of file +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 8e9a9a5a68..db5b3c3b19 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -8,4 +8,4 @@ "program": "${file}" } ] -} \ No newline at end of file +} From 837dba57ac75c5e81c4c6d5225d7dbad64baf312 Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Wed, 27 Sep 2023 18:30:23 +0300 Subject: [PATCH 3/7] fixup! fixup! feat: add devfile and vscode settings to the repo --- .devfile.Dockerfile | 21 +++++++++++++ .github/workflows/devfile-ci.yaml | 49 +++++++++++++++++++++++++++++++ devfile.yaml | 27 ++++++++++++++++- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .devfile.Dockerfile create mode 100644 .github/workflows/devfile-ci.yaml diff --git a/.devfile.Dockerfile b/.devfile.Dockerfile new file mode 100644 index 0000000000..ef725ca602 --- /dev/null +++ b/.devfile.Dockerfile @@ -0,0 +1,21 @@ +# Copyright (c) 2023 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation + +# This container featres tools required for Devspaces Images +FROM quay.io/devfile/universal-developer-image:ubi8-latest + +#install Go 1.18 (needed to work with devspaces-operator) +RUN cd /tmp && wget https://go.dev/dl/go1.18.6.linux-amd64.tar.gz && \ + mkdir $HOME/go1.18 && \ + tar -xvzf go1.18.6.linux-amd64.tar.gz -C $HOME/go1.18 --strip-components 1 && \ + if ! grep -q "export PATH=\$HOME/go1.18/bin:\$PATH" $HOME/.bashrc; then echo "export PATH=\$HOME/go1.18/bin:\$PATH" >> $HOME/.bashrc; fi + +# install goimports (needed to work with devspaces-operator) +RUN $HOME/go1.18/bin/go install golang.org/x/tools/cmd/goimports@latest diff --git a/.github/workflows/devfile-ci.yaml b/.github/workflows/devfile-ci.yaml new file mode 100644 index 0000000000..7546802177 --- /dev/null +++ b/.github/workflows/devfile-ci.yaml @@ -0,0 +1,49 @@ +# +# Copyright (c) 2023 Red Hat, Inc. +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: Devfile image CI + +on: + push: + branches: + - 'main' + paths: + - '.devfile.Dockerfile' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to quay.io + uses: docker/login-action@v2 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + - + name: Build and push container + uses: docker/build-push-action@v4 + with: + context: . + file: .devfile.Dockerfile + push: true + tags: quay.io/devspaces/devspaces-images-dev:latest diff --git a/devfile.yaml b/devfile.yaml index dcd36056af..58adf3b0e6 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -13,4 +13,29 @@ schemaVersion: 2.2.0 metadata: name: devspaces-images # add components:, unless basic udi component is good enough? -# add commands: for building all of the containers? +components: + - name: tools + container: + image: quay.io/devspaces/devspaces-images-dev:latest + memoryRequest: 1Gi + memoryLimit: 8Gi + cpuLimit: '4' + cpuRequest: '0.5' +commands: + #devspaces-operator + - id: operator-go-build + exec: + label: Build Eclipse Che Operator binary + component: tooling-container + commandLine: cd devspaces-operator && make build + - id: operator-go-run + exec: + label: Run Eclipse Che Operator + component: tooling-container + commandLine: cd devspaces-operator && make run + - id: operator-go-test + exec: + label: Run unit tests + component: tooling-container + commandLine: cd devspaces-operator && make test + #devspaces-operator-bundle From 13d765a54ad50761d58129c5436801dfc40fcc6c Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Wed, 29 Nov 2023 10:50:08 +0200 Subject: [PATCH 4/7] fixup! fixup! fixup! feat: add devfile and vscode settings to the repo --- devfile.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/devfile.yaml b/devfile.yaml index 58adf3b0e6..47b004f91f 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -12,11 +12,10 @@ schemaVersion: 2.2.0 metadata: name: devspaces-images -# add components:, unless basic udi component is good enough? components: - name: tools container: - image: quay.io/devspaces/devspaces-images-dev:latest + image: quay.io/devfile/universal-developer-image:ubi8-latest memoryRequest: 1Gi memoryLimit: 8Gi cpuLimit: '4' @@ -27,15 +26,18 @@ commands: exec: label: Build Eclipse Che Operator binary component: tooling-container - commandLine: cd devspaces-operator && make build + commandLine: make build + workingDir: ${PROJECT_SOURCE}/devspaces-operator - id: operator-go-run exec: label: Run Eclipse Che Operator component: tooling-container - commandLine: cd devspaces-operator && make run + commandLine: make run + workingDir: ${PROJECT_SOURCE}/devspaces-operator - id: operator-go-test exec: label: Run unit tests component: tooling-container - commandLine: cd devspaces-operator && make test + commandLine: make test + workingDir: ${PROJECT_SOURCE}/devspaces-operator #devspaces-operator-bundle From 9d79b1fffa5ce15641d4ee5bab8e97d6084de800 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Fri, 1 Dec 2023 13:10:51 -0400 Subject: [PATCH 5/7] Update devfile.yaml --- devfile.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devfile.yaml b/devfile.yaml index 47b004f91f..3b0c585a06 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2019-2021 Red Hat, Inc. +# Copyright (c) 2023 Red Hat, Inc. # This program and the accompanying materials are made # available under the terms of the Eclipse Public License 2.0 # which is available at https://www.eclipse.org/legal/epl-2.0/ From 72409d3394bcdd4d471af95b0a566a15615237d4 Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Wed, 3 Jan 2024 09:26:35 +0200 Subject: [PATCH 6/7] fixup! Update devfile.yaml --- devspaces-operator/devfile.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/devspaces-operator/devfile.yaml b/devspaces-operator/devfile.yaml index 5759adf3a1..095636a8ed 100644 --- a/devspaces-operator/devfile.yaml +++ b/devspaces-operator/devfile.yaml @@ -34,6 +34,22 @@ components: - name: KUBECONFIG value: /home/user/.kube/config commands: + - id: install-chectl + exec: + label: POST START EVENT - Install chectl + component: tooling-container + commandLine: | + tag=$(curl https://api.github.com/repos/che-incubator/chectl/tags | jq -r '.[0].name') && \ + cd /tmp && wget https://github.com/che-incubator/chectl/releases/download/${tag}/chectl-linux-x64.tar.gz && \ + mkdir $HOME/chectl && \ + tar -xvzf chectl-linux-x64.tar.gz -C $HOME/chectl --strip-components 1 && \ + if ! grep -q "export PATH=\$HOME/chectl/bin:\$PATH" $HOME/.bashrc; then echo "export PATH=\$HOME/chectl/bin:\$PATH" >> $HOME/.bashrc; fi + - id: install-goimports + exec: + label: POST START EVENT - Install goimports + component: tooling-container + commandLine: | + $HOME/go1.18/bin/go install golang.org/x/tools/cmd/goimports@latest - id: go-build exec: label: Build Eclipse Che Operator binary From 3a1cd3b35a32e9314b8efa3fc4f752e015afb571 Mon Sep 17 00:00:00 2001 From: Mykhailo Kuznietsov Date: Mon, 22 Jan 2024 16:14:40 +0200 Subject: [PATCH 7/7] fixup! fixup! Update devfile.yaml --- devspaces-operator/devfile.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/devspaces-operator/devfile.yaml b/devspaces-operator/devfile.yaml index 095636a8ed..93aa016732 100644 --- a/devspaces-operator/devfile.yaml +++ b/devspaces-operator/devfile.yaml @@ -13,7 +13,7 @@ schemaVersion: 2.1.0 attributes: controller.devfile.io/storage-type: ephemeral metadata: - name: che-operator + name: devspaces-images components: - name: tooling-container container: @@ -49,7 +49,7 @@ commands: label: POST START EVENT - Install goimports component: tooling-container commandLine: | - $HOME/go1.18/bin/go install golang.org/x/tools/cmd/goimports@latest + go install golang.org/x/tools/cmd/goimports@latest - id: go-build exec: label: Build Eclipse Che Operator binary @@ -74,4 +74,8 @@ commands: exec: label: Update all development resources component: tooling-container - commandLine: make update-dev-resources + commandLine: make update-dev-resources +events: + postStart: + - install-goimports + - install-chectl