mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Fix async initialization of Workers and remove unused workflow service
This commit is contained in:
61
.github/workflows/release.yml
vendored
61
.github/workflows/release.yml
vendored
@@ -269,67 +269,6 @@ jobs:
|
||||
|
||||
|
||||
|
||||
workflow-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/workflow
|
||||
ghcr.io/oneuptime/workflow
|
||||
tags: |
|
||||
type=raw,value=release,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}},pattern={{version}},enable=true
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy workflow.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./Workflow/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
|
||||
status-page-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
65
.github/workflows/test-release.yaml
vendored
65
.github/workflows/test-release.yaml
vendored
@@ -141,69 +141,6 @@ jobs:
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
workflow-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Docker Meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
oneuptime/workflow
|
||||
ghcr.io/oneuptime/workflow
|
||||
tags: |
|
||||
type=raw,value=test,enable=true
|
||||
type=semver,value=7.0.${{needs.generate-build-number.outputs.build_number}}-test,pattern={{version}},enable=true
|
||||
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18.3.0
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Generate Dockerfile from Dockerfile.tpl
|
||||
run: npm run prerun
|
||||
|
||||
# Build and deploy workflow.
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2.2.0
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.repository_owner }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
file: ./Workflow/Dockerfile
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
GIT_SHA=${{ github.sha }}
|
||||
APP_VERSION=7.0.${{needs.generate-build-number.outputs.build_number}}
|
||||
|
||||
|
||||
|
||||
otel-collector-docker-image-deploy:
|
||||
needs: generate-build-number
|
||||
runs-on: ubuntu-latest
|
||||
@@ -818,7 +755,7 @@ jobs:
|
||||
|
||||
test-helm-chart:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-server-docker-image-deploy, test-docker-image-deploy, ingestor-docker-image-deploy, probe-docker-image-deploy, haraka-docker-image-deploy, dashboard-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, accounts-docker-image-deploy, otel-collector-docker-image-deploy, workers-docker-image-deploy, status-page-docker-image-deploy, workflow-docker-image-deploy, nginx-docker-image-deploy]
|
||||
needs: [test-server-docker-image-deploy, test-docker-image-deploy, ingestor-docker-image-deploy, probe-docker-image-deploy, haraka-docker-image-deploy, dashboard-docker-image-deploy, admin-dashboard-docker-image-deploy, app-docker-image-deploy, accounts-docker-image-deploy, otel-collector-docker-image-deploy, status-page-docker-image-deploy, nginx-docker-image-deploy]
|
||||
env:
|
||||
CI_PIPELINE_ID: ${{github.run_number}}
|
||||
steps:
|
||||
|
||||
@@ -39,7 +39,7 @@ const init: () => Promise<void> = async (): Promise<void> => {
|
||||
|
||||
// init workers
|
||||
|
||||
Workers.init();
|
||||
await Workers.init();
|
||||
} catch (err) {
|
||||
logger.error('App Init Failed:');
|
||||
logger.error(err);
|
||||
|
||||
@@ -60,11 +60,6 @@ export const ClusterKey: ObjectID = new ObjectID(
|
||||
|
||||
export const HasClusterKey: boolean = Boolean(process.env['ONEUPTIME_SECRET']);
|
||||
|
||||
export const WorkflowHostname: Hostname = Hostname.fromString(
|
||||
`${process.env['SERVER_WORKFLOW_HOSTNAME'] || 'localhost'}:${
|
||||
process.env['WORKFLOW_PORT'] || 80
|
||||
}`
|
||||
);
|
||||
|
||||
export const AppApiHostname: Hostname = Hostname.fromString(
|
||||
`${process.env['SERVER_APP_HOSTNAME'] || 'localhost'}:${
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
value: {{ $.Release.Name }}-accounts.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
|
||||
- name: SERVER_APP_HOSTNAME
|
||||
value: {{ $.Release.Name }}-app.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
|
||||
- name: SERVER_WORKFLOW_HOSTNAME
|
||||
value: {{ $.Release.Name }}-workflow.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
|
||||
- name: SERVER_INGESTOR_HOSTNAME
|
||||
value: {{ $.Release.Name }}-ingestor.{{ $.Release.Namespace }}.svc.{{ $.Values.global.clusterDomain }}
|
||||
- name: SERVER_TEST_SERVER_HOSTNAME
|
||||
@@ -44,8 +42,6 @@
|
||||
|
||||
- name: APP_PORT
|
||||
value: {{ $.Values.port.app | squote }}
|
||||
- name: WORKFLOW_PORT
|
||||
value: {{ $.Values.port.workflow | squote }}
|
||||
- name: INGESTOR_PORT
|
||||
value: {{ $.Values.port.ingestor | squote }}
|
||||
- name: PROBE_PORT
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# OneUptime workflow Deployment
|
||||
{{- $workflowEnv := dict "PORT" $.Values.port.workflow -}}
|
||||
{{- $workflowDeploymentArgs :=dict "IsServer" true "ServiceName" "workflow" "Port" $.Values.port.workflow "Release" $.Release "Values" $.Values "Env" $workflowEnv -}}
|
||||
{{- include "oneuptime.deployment" $workflowDeploymentArgs }}
|
||||
---
|
||||
|
||||
# OneUptime workflow Service
|
||||
|
||||
{{- $workflowServiceArgs := dict "ServiceName" "workflow" "Port" $.Values.port.workflow "Release" $.Release "Values" $.Values -}}
|
||||
{{- include "oneuptime.service" $workflowServiceArgs }}
|
||||
---
|
||||
|
||||
# OneUptime workflow autoscaler
|
||||
{{- $workflowAutoScalerArgs := dict "ServiceName" "workflow" "Release" $.Release "Values" $.Values -}}
|
||||
{{- include "oneuptime.autoscaler" $workflowAutoScalerArgs }}
|
||||
---
|
||||
@@ -9,10 +9,6 @@ upstream app {
|
||||
server ${SERVER_APP_HOSTNAME}:${APP_PORT} weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
upstream workflow {
|
||||
server ${SERVER_WORKFLOW_HOSTNAME}:${WORKFLOW_PORT} weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
upstream ingestor {
|
||||
server ${SERVER_INGESTOR_HOSTNAME}:${INGESTOR_PORT} weight=10 max_fails=3 fail_timeout=30s;
|
||||
}
|
||||
|
||||
@@ -80,8 +80,6 @@ INGESTOR_HOSTNAME=ingestor:3400
|
||||
SERVER_ACCOUNTS_HOSTNAME=accounts
|
||||
SERVER_REALTIME_HOSTNAME=realtime
|
||||
SERVER_APP_HOSTNAME=app
|
||||
SERVER_WORKFLOW_HOSTNAME=workflow
|
||||
SERVER_ALERT_HOSTNAME=alert
|
||||
SERVER_INGESTOR_HOSTNAME=ingestor
|
||||
SERVER_TEST_SERVER_HOSTNAME=test-server
|
||||
SERVER_STATUS_PAGE_HOSTNAME=status-page
|
||||
@@ -92,7 +90,6 @@ SERVER_OTEL_COLLECTOR_HOSTNAME=otel-collector
|
||||
#Ports. Usually they don't need to change.
|
||||
|
||||
APP_PORT=3002
|
||||
WORKFLOW_PORT=3099
|
||||
INGESTOR_PORT=3400
|
||||
PROBE_PORT=3500
|
||||
TEST_SERVER_PORT=3800
|
||||
|
||||
@@ -20,7 +20,6 @@ x-common-variables: &common-variables
|
||||
SERVER_ACCOUNTS_HOSTNAME: accounts
|
||||
SERVER_REALTIME_HOSTNAME: realtime
|
||||
SERVER_APP_HOSTNAME: app
|
||||
SERVER_WORKFLOW_HOSTNAME: workflow
|
||||
SERVER_ALERT_HOSTNAME: alert
|
||||
SERVER_INGESTOR_HOSTNAME: ingestor
|
||||
SERVER_TEST_SERVER_HOSTNAME: test-server
|
||||
@@ -31,7 +30,6 @@ x-common-variables: &common-variables
|
||||
|
||||
#Ports. Usually they don't need to change.
|
||||
APP_PORT: ${APP_PORT}
|
||||
WORKFLOW_PORT: ${WORKFLOW_PORT}
|
||||
INGESTOR_PORT: ${INGESTOR_PORT}
|
||||
PROBE_PORT: ${PROBE_PORT}
|
||||
TEST_SERVER_PORT: ${TEST_SERVER_PORT}
|
||||
@@ -206,20 +204,6 @@ services:
|
||||
- postgres
|
||||
volumes:
|
||||
- ./Certs:/usr/src/Certs
|
||||
|
||||
workflow:
|
||||
networks:
|
||||
- oneuptime
|
||||
restart: always
|
||||
environment:
|
||||
<<: *common-server-variables
|
||||
PORT: ${WORKFLOW_PORT}
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
links:
|
||||
- redis
|
||||
- postgres
|
||||
|
||||
|
||||
probe-1:
|
||||
|
||||
@@ -199,32 +199,6 @@ services:
|
||||
dockerfile: ./App/Dockerfile
|
||||
|
||||
|
||||
workflow:
|
||||
volumes:
|
||||
- ./Workflow:/usr/src/app
|
||||
# Use node modules of the container and not host system.
|
||||
# https://stackoverflow.com/questions/29181032/add-a-volume-to-docker-but-exclude-a-sub-folder
|
||||
- /usr/src/app/node_modules/
|
||||
- ./Common:/usr/src/Common
|
||||
- ./Model:/usr/src/Model
|
||||
- ./CommonServer:/usr/src/CommonServer
|
||||
- ./CommonUI:/usr/src/CommonUI
|
||||
- /usr/src/Common/node_modules/
|
||||
- /usr/src/CommonUI/node_modules/
|
||||
- /usr/src/CommonServer/node_modules/
|
||||
- /usr/src/Model/node_modules/
|
||||
extends:
|
||||
file: ./docker-compose.base.yml
|
||||
service: workflow
|
||||
ports:
|
||||
- '9212:9229' # Debugging port.
|
||||
build:
|
||||
network: host
|
||||
context: .
|
||||
dockerfile: ./Workflow/Dockerfile
|
||||
|
||||
|
||||
|
||||
probe-1:
|
||||
volumes:
|
||||
- ./Probe:/usr/src/app
|
||||
|
||||
@@ -66,13 +66,6 @@ services:
|
||||
extends:
|
||||
file: ./docker-compose.base.yml
|
||||
service: app
|
||||
|
||||
|
||||
workflow:
|
||||
image: oneuptime/workflow:${APP_TAG}
|
||||
extends:
|
||||
file: ./docker-compose.base.yml
|
||||
service: workflow
|
||||
|
||||
probe-1:
|
||||
image: oneuptime/probe:${APP_TAG}
|
||||
|
||||
Reference in New Issue
Block a user