Skip to content
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

Fix workflows and monitor extension #280

Merged
merged 4 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions .github/workflows/publish-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ name: Publish Demos CI
on:
workflow_dispatch:
inputs:
publish_type:
description: "Which build to trigger"
required: true
default: "next"
type: choice
options:
- next
- latest
publish_theia_cloud_demo:
description: "Publish theia-cloud-demo?"
type: boolean
Expand All @@ -26,40 +18,38 @@ on:

jobs:
publish-theia-cloud-demo:
if: ${{ inputs.publish_theia_cloud_demo == true }}
if: inputs.publish_theia_cloud_demo == true
uses: ./.github/workflows/reusable-demo.yml
with:
docker_org: theiacloud
docker_image: theia-cloud-demo
docker_file: demo/dockerfiles/demo-theia-docker/Dockerfile
docker_location: demo/dockerfiles/demo-theia-docker/.
publish_type: ${{ inputs.publish_type }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}

publish-theia-cloud-activity-demo-theia:
if: ${{ inputs.publish_theia_cloud_activity_demo_theia == true }}
if: inputs.publish_theia_cloud_activity_demo_theia == true
uses: ./.github/workflows/reusable-demo.yml
with:
docker_org: theiacloud
docker_image: theia-cloud-activity-demo-theia
docker_file: demo/dockerfiles/demo-theia-monitor-theia/Dockerfile
docker_location: .
publish_type: ${{ inputs.publish_type }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}

publish-theia-cloud-activity-demo:
if: ${{ inputs.publish_theia_cloud_activity_demo == true }}
if: inputs.publish_theia_cloud_activity_demo == true
needs: publish-theia-cloud-demo
uses: ./.github/workflows/reusable-demo.yml
with:
docker_org: theiacloud
docker_image: theia-cloud-activity-demo
docker_file: demo/dockerfiles/demo-theia-monitor-vscode/Dockerfile
docker_location: demo/dockerfiles/demo-theia-monitor-vscode/.
publish_type: ${{ inputs.publish_type }}
secrets:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
63 changes: 25 additions & 38 deletions .github/workflows/reusable-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,54 +15,31 @@ on:
docker_location:
required: true
type: string
publish_type:
description: "Publish as latest ('latest') or next ('next')"
required: true
type: string
secrets:
dockerhub_username:
required: true
dockerhub_token:
required: true

env:
VERSION: 0.9.1
VERSION: 0.10.0-next

jobs:
publish-next:
check-version:
runs-on: ubuntu-latest
if: ${{ inputs.publish_type == 'next' }}

outputs:
is_next_version: ${{ steps.version_check.outputs.is_next_version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Create docker tags
id: get_tags
run: |
echo "sha_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}.$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "version_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT

- name: Build Docker image
run: docker build -t ${{ steps.get_tags.outputs.version_tag }} -f ${{ inputs.docker_file }} ${{ inputs.docker_location }}

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_token }}

# Push version and SHA tag for main pushes of next versions (This avoids duplicate pushes for release commits on main)
- name: Push version and SHA tag
if: endsWith(env.VERSION, '-next')
- id: version_check
run: |
docker push ${{ steps.get_tags.outputs.version_tag }}
docker tag ${{ steps.get_tags.outputs.version_tag }} ${{ steps.get_tags.outputs.sha_tag }}
docker push ${{ steps.get_tags.outputs.sha_tag }}
if [[ $VERSION == *"-next" ]]; then
echo "::set-output name=is_next_version::true"
else
echo "::set-output name=is_next_version::false"
fi

publish-latest:
publish-next:
runs-on: ubuntu-latest
if: ${{ inputs.publish_type == 'latest' }}

steps:
- name: Checkout Repository
Expand All @@ -72,7 +49,8 @@ jobs:
id: get_tags
run: |
echo "version_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}" >> $GITHUB_OUTPUT
echo "next_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}-next" >> $GITHUB_OUTPUT
echo "next_sha_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}.$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_OUTPUT
echo "next_tag_for_release=${{ inputs.docker_org }}/${{ inputs.docker_image }}:${{ env.VERSION }}-next" >> $GITHUB_OUTPUT
echo "latest_tag=${{ inputs.docker_org }}/${{ inputs.docker_image }}:latest" >> $GITHUB_OUTPUT

- name: Build Docker image
Expand All @@ -84,11 +62,20 @@ jobs:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_token }}

# Push version, next and latest tag for releases (version should be valid semver)
# Push version and SHA tag (for next versions)
- name: Push version and SHA tag
if: needs.check-version.outputs.is_next_version == 'true'
run: |
docker push ${{ steps.get_tags.outputs.version_tag }}
docker tag ${{ steps.get_tags.outputs.version_tag }} ${{ steps.get_tags.outputs.next_sha_tag }}
docker push ${{ steps.get_tags.outputs.next_sha_tag }}

# Push version, next and latest tag for releases (for valid semver versions)
- name: Push version and latest tag
if: needs.check-version.outputs.is_next_version == 'false'
run: |
docker push ${{ steps.get_tags.outputs.version_tag }}
docker tag ${{ steps.get_tags.outputs.version_tag }} ${{ steps.get_tags.outputs.latest_tag }}
docker push ${{ steps.get_tags.outputs.latest_tag }}
docker tag ${{ steps.get_tags.outputs.version_tag }} ${{ steps.get_tags.outputs.next_tag }}
docker push ${{ steps.get_tags.outputs.next_tag }}
docker tag ${{ steps.get_tags.outputs.version_tag }} ${{ steps.get_tags.outputs.next_tag_for_release }}
docker push ${{ steps.get_tags.outputs.next_tag_for_release }}
19 changes: 16 additions & 3 deletions .github/workflows/reusable-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
required: true

env:
VERSION: 0.9.1
VERSION: 0.10.0-next

jobs:
build:
Expand All @@ -39,9 +39,23 @@ jobs:
run: |
docker build -t ${{ steps.get_tags.outputs.version_tag }} -f ${{ inputs.docker_file }} .

check-version:
runs-on: ubuntu-latest
if: github.event_name == 'next'
outputs:
is_next_version: ${{ steps.version_check.outputs.is_next_version }}
steps:
- id: version_check
run: |
if [[ $VERSION == *"-next" ]]; then
echo "::set-output name=is_next_version::true"
else
echo "::set-output name=is_next_version::false"
fi

publish-next:
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: github.event_name == 'next' && needs.check-version.outputs.is_next_version == 'true'

steps:
- name: Checkout Repository
Expand All @@ -64,7 +78,6 @@ jobs:

# Push version and SHA tag for main pushes of next versions (This avoids duplicate pushes for release commits on main)
- name: Push version and SHA tag
if: endsWith(env.VERSION, '-next')
run: |
docker push ${{ steps.get_tags.outputs.version_tag }}
docker tag ${{ steps.get_tags.outputs.version_tag }} ${{ steps.get_tags.outputs.sha_tag }}
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/reusable-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,23 @@ jobs:
- name: Build package
run: npm run build -w ${{ inputs.package_workspace }}

check-version:
runs-on: ubuntu-latest
if: github.event_name == 'next'
outputs:
is_next_version: ${{ steps.version_check.outputs.is_next_version }}
steps:
- id: version_check
run: |
if [[ $VERSION == *"-next" ]]; then
echo "::set-output name=is_next_version::true"
else
echo "::set-output name=is_next_version::false"
fi

publish-next:
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: github.event_name == 'next' && needs.check-version.outputs.is_next_version == 'true'
defaults:
run:
working-directory: ./node
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.10.0] - estimated 2024-04

- [.github/workflows] Improve version detection in workflows (do not build release commits, auto-detect version for demo publishing) [#280](https://github.com/eclipsesource/theia-cloud/pull/280) - contributed on behalf of STMicroelectronics
- [node] Separate `monitor` package from other workspaces to fix bundling the extension [#280](https://github.com/eclipsesource/theia-cloud/pull/280) - contributed on behalf of STMicroelectronics

## [0.9.0] - 2024-01-23

- [node/landing-page] Make npm workspace and remove yarn references from repo [#258](https://github.com/eclipsesource/theia-cloud/pull/258) | [#45](https://github.com/eclipsesource/theia-cloud-helm/pull/45) - contributed on behalf of STMicroelectronics
Expand Down
4 changes: 2 additions & 2 deletions demo/dockerfiles/demo-theia-monitor-vscode/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM theiacloud/theia-cloud-demo:0.9.1 as production-stage
FROM theiacloud/theia-cloud-demo:0.10.0-next as production-stage

COPY --chown=theia:theia theiacloud-monitor-0.9.1.vsix /home/theia/plugins
COPY --chown=theia:theia theiacloud-monitor-0.10.0-next.vsix /home/theia/plugins
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions dockerfiles/operator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN mkdir /templates
WORKDIR /log-config
COPY java/operator/org.eclipse.theia.cloud.operator/log4j2.xml .
WORKDIR /operator
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.operator/target/operator-0.9.1-jar-with-dependencies.jar .
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.operator/target/operator-0.10.0-SNAPSHOT-jar-with-dependencies.jar .
# to get more debug information from the kubernetes client itself, add -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG below
ENTRYPOINT [ "java", "-Dlog4j2.configurationFile=/log-config/log4j2.xml", "-jar", "./operator-0.9.1-jar-with-dependencies.jar" ]
ENTRYPOINT [ "java", "-Dlog4j2.configurationFile=/log-config/log4j2.xml", "-jar", "./operator-0.10.0-SNAPSHOT-jar-with-dependencies.jar" ]
CMD [ "" ]
4 changes: 2 additions & 2 deletions dockerfiles/operator/Dockerfile.withcache
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN mkdir /templates
WORKDIR /log-config
COPY java/operator/org.eclipse.theia.cloud.operator/log4j2.xml .
WORKDIR /operator
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.operator/target/operator-0.9.1-jar-with-dependencies.jar .
COPY --from=builder /operator/operator/org.eclipse.theia.cloud.operator/target/operator-0.10.0-SNAPSHOT-jar-with-dependencies.jar .
# to get more debug information from the kubernetes client itself, add -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG below
ENTRYPOINT [ "java", "-Dlog4j2.configurationFile=/log-config/log4j2.xml", "-jar", "./operator-0.9.1-jar-with-dependencies.jar" ]
ENTRYPOINT [ "java", "-Dlog4j2.configurationFile=/log-config/log4j2.xml", "-jar", "./operator-0.10.0-SNAPSHOT-jar-with-dependencies.jar" ]
CMD [ "" ]
4 changes: 2 additions & 2 deletions dockerfiles/service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN cd /service/common/maven-conf && \

FROM eclipse-temurin:17-jre-alpine
WORKDIR /service
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/target/service-0.9.1-runner.jar .
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/target/service-0.10.0-SNAPSHOT-runner.jar .
ENV APPID default-app-id
ENV SERVICE_PORT 8081

Expand All @@ -29,5 +29,5 @@ ENTRYPOINT java -Dtheia.cloud.app.id=${APPID} \
-Dquarkus.oidc.auth-server-url=${KEYCLOAK_SERVERURL} \
-Dquarkus.oidc.client-id=${KEYCLOAK_CLIENTID} \
-Dquarkus.oidc.credentials.secret=${KEYCLOAK_CLIENTSECRET} \
-jar ./service-0.9.1-runner.jar
-jar ./service-0.10.0-SNAPSHOT-runner.jar
CMD [ "" ]
4 changes: 2 additions & 2 deletions dockerfiles/service/Dockerfile.withcache
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN --mount=type=cache,target=/root/.m2 \

FROM eclipse-temurin:17-jre-alpine
WORKDIR /service
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/target/service-0.9.1-runner.jar .
COPY --from=builder /service/service/org.eclipse.theia.cloud.service/target/service-0.10.0-SNAPSHOT-runner.jar .
ENV APPID default-app-id
ENV SERVICE_PORT 8081

Expand All @@ -30,5 +30,5 @@ ENTRYPOINT java -Dtheia.cloud.app.id=${APPID} \
-Dquarkus.oidc.auth-server-url=${KEYCLOAK_SERVERURL} \
-Dquarkus.oidc.client-id=${KEYCLOAK_CLIENTID} \
-Dquarkus.oidc.credentials.secret=${KEYCLOAK_CLIENTSECRET} \
-jar ./service-0.9.1-runner.jar
-jar ./service-0.10.0-SNAPSHOT-runner.jar
CMD [ "" ]
4 changes: 3 additions & 1 deletion dockerfiles/try-now-page/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ FROM node:lts-alpine as build-stage
ENV DISABLE_ESLINT_PLUGIN=true
WORKDIR /app
COPY node/package*.json ./
COPY node/tsconfig.json ./
COPY node/common/package.json ./common/package.json
COPY node/try-now-page/package.json ./try-now-page/package.json
RUN npm ci
COPY node/configs/ ./configs/
COPY node/common/ ./common/
COPY node/try-now-page/ ./try-now-page/
RUN npm run build && \
RUN npm run build -w common && \
npm run build -w try-now-page && \
chmod 644 /app/try-now-page/build/terms.html && \
chmod 644 /app/try-now-page/build/favicon.ico

Expand Down
4 changes: 2 additions & 2 deletions helm/theia.cloud/valuesGKETryNow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ issuer:
email: jfaltermeier@eclipsesource.com

image:
name: theiacloud/theia-cloud-demo:0.9.1
name: theiacloud/theia-cloud-demo:0.10.0-next
pullSecret: ""
timeoutStrategy: "FIXEDTIME"
timeoutLimit: "30"
Expand All @@ -22,7 +22,7 @@ hosts:
instance: ws.theia-cloud.io

landingPage:
image: theiacloud/theia-cloud-try-now-page:0.9.1
image: theiacloud/theia-cloud-try-now-page:0.10.0-next
appDefinition: "theia-cloud-demo"
ephemeralStorage: true
additionalApps:
Expand Down
4 changes: 2 additions & 2 deletions helm/theia.cloud/valuesMonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ app:
name: Theia Blueprint

image:
name: theiacloud/theia-cloud-activity-demo:0.9.1
name: theiacloud/theia-cloud-activity-demo:0.10.0-next
pullSecret: ""
timeoutStrategy: "FIXEDTIME"
timeoutLimit: "0"
Expand All @@ -19,7 +19,7 @@ hosts:
instance: ws.theia-cloud.io

landingPage:
image: theiacloud/theia-cloud-try-now-page:0.9.1
image: theiacloud/theia-cloud-try-now-page:0.10.0-next
appDefinition: "theia-cloud-demo"
ephemeralStorage: true

Expand Down
2 changes: 1 addition & 1 deletion helm/theia.cloud/valuesTestTrynowPage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ hosts:
instance: ws.192.168.39.3.nip.io

landingPage:
image: theiacloud/theia-cloud-try-now-page:0.9.1
image: theiacloud/theia-cloud-try-now-page:0.10.0-next
imagePullPolicy: Always
appDefinition: "theia-cloud-demo"
ephemeralStorage: true
Expand Down
2 changes: 1 addition & 1 deletion java/common/maven-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>0.9.1</version>
<version>0.10.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Theia.Cloud Maven Configuration</name>
<description>Common properties and configuration</description>
Expand Down
2 changes: 1 addition & 1 deletion java/common/org.eclipse.theia.cloud.common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>0.9.1</version>
<version>0.10.0-SNAPSHOT</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions java/operator/org.eclipse.theia.cloud.operator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>conf</artifactId>
<version>0.9.1</version>
<version>0.10.0-SNAPSHOT</version>
<relativePath>../../common/maven-conf/</relativePath>
</parent>

Expand All @@ -23,7 +23,7 @@
<dependency>
<groupId>org.eclipse.theia.cloud</groupId>
<artifactId>common</artifactId>
<version>0.9.1</version>
<version>0.10.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
Expand Down
Loading
Loading