Skip to content

Commit

Permalink
Merge pull request #7211 from ever-co/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
evereq authored Nov 29, 2023
2 parents 47ebef0 + 2a5bba4 commit 6355ca6
Show file tree
Hide file tree
Showing 28 changed files with 79 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .deploy/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG API_BASE_URL
ARG CLIENT_BASE_URL
ARG API_HOST
ARG API_PORT
ARG CLOUD_PROVIDER
ARG SENTRY_DSN
ARG SENTRY_HTTP_TRACING_ENABLED
ARG SENTRY_POSTGRES_TRACKING_ENABLED
Expand Down Expand Up @@ -267,6 +268,7 @@ ENV DB_TYPE=${DB_TYPE:-sqlite}
ENV DB_SSL_MODE=${DB_SSL_MODE}
ENV DB_CA_CERT=${DB_CA_CERT}
ENV DEMO=${DEMO:-false}
ENV CLOUD_PROVIDER=${CLOUD_PROVIDER}
ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
ENV AWS_REGION=${AWS_REGION}
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.civo.demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
value: 'refreshSecretKey'
- name: JWT_REFRESH_TOKEN_EXPIRATION_TIME
value: '86400'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: OTEL_ENABLED
value: '$OTEL_ENABLED'
- name: OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.civo.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ spec:
value: 'true'
- name: LOG_LEVEL
value: 'info'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: SENTRY_DSN
value: '$SENTRY_DSN'
- name: SENTRY_HTTP_TRACING_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.civo.stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ spec:
value: 'true'
- name: LOG_LEVEL
value: 'info'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: SENTRY_DSN
value: '$SENTRY_DSN'
- name: SENTRY_HTTP_TRACING_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.cw.demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
value: 0.0.0.0
- name: DEMO
value: 'true'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: NODE_ENV
value: 'development'
- name: ADMIN_PASSWORD_RESET
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.cw.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ spec:
value: 'true'
- name: LOG_LEVEL
value: 'info'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: SENTRY_DSN
value: '$SENTRY_DSN'
- name: SENTRY_HTTP_TRACING_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.cw.stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ spec:
value: 'true'
- name: LOG_LEVEL
value: 'info'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: SENTRY_DSN
value: '$SENTRY_DSN'
- name: SENTRY_HTTP_TRACING_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ spec:
value: 0.0.0.0
- name: DEMO
value: 'true'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: NODE_ENV
value: 'development'
- name: ADMIN_PASSWORD_RESET
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
value: 'true'
- name: LOG_LEVEL
value: 'info'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: SENTRY_DSN
value: '$SENTRY_DSN'
- name: SENTRY_HTTP_TRACING_ENABLED
Expand Down
2 changes: 2 additions & 0 deletions .deploy/k8s/k8s-manifest.stage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
value: 'true'
- name: LOG_LEVEL
value: 'info'
- name: CLOUD_PROVIDER
value: '$CLOUD_PROVIDER'
- name: SENTRY_DSN
value: '$SENTRY_DSN'
- name: SENTRY_HTTP_TRACING_ENABLED
Expand Down
3 changes: 3 additions & 0 deletions .env.compose
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ WEB_PORT=4200
# set true if running as a Demo
DEMO=true

# DO (DIGITALOCEAN), AWS, AZURE, CIVO, CW (COREWEAVE), HEROKU, LINODE, LOCAL, OVH, SCALEWAY, VULTR, etc
CLOUD_PROVIDER=

ALLOW_SUPER_ADMIN_ROLE=true

# set to Gauzy API base URL
Expand Down
3 changes: 3 additions & 0 deletions .env.docker
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ WEB_PORT=4200
# set true if running as a Demo
DEMO=true

# DO (DIGITALOCEAN), AWS, AZURE, CIVO, CW (COREWEAVE), HEROKU, LINODE, LOCAL, OVH, SCALEWAY, VULTR, etc
CLOUD_PROVIDER=

ALLOW_SUPER_ADMIN_ROLE=true

# set to Gauzy API base URL
Expand Down
3 changes: 3 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ WEB_PORT=4200
# set true if running as a Demo
DEMO=true

# DO (DIGITALOCEAN), AWS, AZURE, CIVO, CW (COREWEAVE), HEROKU, LINODE, LOCAL, OVH, SCALEWAY, VULTR, etc
CLOUD_PROVIDER=

ALLOW_SUPER_ADMIN_ROLE=true

# set to Gauzy API base URL
Expand Down
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ IS_DOCKER=false
# Set true if running as a Demo
DEMO=false

# DO (DIGITALOCEAN), AWS, AZURE, CIVO, CW (COREWEAVE), HEROKU, LINODE, LOCAL, OVH, SCALEWAY, VULTR, etc
CLOUD_PROVIDER=

ALLOW_SUPER_ADMIN_ROLE=true

# Set to Gauzy API base URL
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-civo-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Civo Demo
on:
workflow_run:
workflows: ['Build and Publish Docker Images Demo']
branches: [develop, temp]
branches: [civo]
types:
- completed

Expand Down Expand Up @@ -38,6 +38,7 @@ jobs:
env:
# below we are using GitHub secrets for both frontend and backend
DB_NAME: 'gauzy_demo'
CLOUD_PROVIDER: 'CIVO'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-civo-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Civo Prod
on:
workflow_run:
workflows: ['Build and Publish Docker Images Prod']
branches: [master]
branches: [civo]
types:
- completed

Expand Down Expand Up @@ -46,13 +46,14 @@ jobs:
DB_TYPE: '${{ secrets.DB_TYPE }}'
DB_URI: '${{ secrets.DB_URI }}'
# Note: for now we are using DB in different provider, so we have to use public hostname
DB_HOST: '${{ secrets.DB_HOST_PUBLIC }}'
DB_HOST: '${{ secrets.DB_HOST_CIVO }}'
DB_USER: '${{ secrets.DB_USER }}'
DB_PASS: '${{ secrets.DB_PASS }}'
DB_NAME: 'gauzy-pool'
DB_PORT: '${{ secrets.DB_PORT }}'
DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
DB_SSL_MODE: '${{ secrets.DB_SSL_MODE }}'
CLOUD_PROVIDER: 'CIVO'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/deploy-civo-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to Civo Stage
on:
workflow_run:
workflows: ['Build and Publish Docker Images Stage']
branches: [stage]
branches: [civo]
types:
- completed

Expand Down Expand Up @@ -46,14 +46,15 @@ jobs:
DB_TYPE: '${{ secrets.DB_TYPE }}'
DB_URI: '${{ secrets.DB_URI }}'
# Note: for now we are using DB in different provider, so we have to use public hostname
DB_HOST: '${{ secrets.DB_HOST_PUBLIC }}'
DB_HOST: '${{ secrets.DB_HOST_CIVO }}'
DB_USER: '${{ secrets.DB_USER }}'
DB_PASS: '${{ secrets.DB_PASS }}'
# Note that for staging we are using for now same server, just different DB name
DB_NAME: 'gauzy-stage-pool'
DB_PORT: '${{ secrets.DB_PORT }}'
DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
DB_SSL_MODE: '${{ secrets.DB_SSL_MODE }}'
CLOUD_PROVIDER: 'CIVO'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-cw-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to CoreWeave Demo
on:
workflow_run:
workflows: ['Build and Publish Docker Images Demo']
branches: [develop, temp]
branches: [develop]
types:
- completed

Expand Down Expand Up @@ -37,6 +37,7 @@ jobs:
envsubst < $GITHUB_WORKSPACE/.deploy/k8s/k8s-manifest.cw.demo.yaml | kubectl --context coreweave apply -f -
env:
# below we are using GitHub secrets for both frontend and backend
CLOUD_PROVIDER: 'CW'
DB_NAME: 'gauzy_demo'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-cw-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ jobs:
DB_TYPE: '${{ secrets.DB_TYPE }}'
DB_URI: '${{ secrets.DB_URI }}'
# Note: for now we are using DB in different provider, so we have to use public hostname
DB_HOST: '${{ secrets.DB_HOST_PUBLIC }}'
DB_HOST: '${{ secrets.DB_HOST_CW }}'
DB_USER: '${{ secrets.DB_USER }}'
DB_PASS: '${{ secrets.DB_PASS }}'
DB_NAME: 'gauzy-pool'
DB_PORT: '${{ secrets.DB_PORT }}'
DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
DB_SSL_MODE: '${{ secrets.DB_SSL_MODE }}'
CLOUD_PROVIDER: 'CW'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-cw-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@ jobs:
DB_TYPE: '${{ secrets.DB_TYPE }}'
DB_URI: '${{ secrets.DB_URI }}'
# Note: for now we are using DB in different provider, so we have to use public hostname
DB_HOST: '${{ secrets.DB_HOST_PUBLIC }}'
DB_HOST: '${{ secrets.DB_HOST_CW }}'
DB_USER: '${{ secrets.DB_USER }}'
DB_PASS: '${{ secrets.DB_PASS }}'
# Note that for staging we are using for now same server, just different DB name
DB_NAME: 'gauzy-stage-pool'
DB_PORT: '${{ secrets.DB_PORT }}'
DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
DB_SSL_MODE: '${{ secrets.DB_SSL_MODE }}'
CLOUD_PROVIDER: 'CW'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/deploy-do-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy to DigitalOcean Demo
on:
workflow_run:
workflows: ['Build and Publish Docker Images Demo']
branches: [develop, temp]
branches: [develop]
types:
- completed

Expand Down Expand Up @@ -33,6 +33,7 @@ jobs:
envsubst < $GITHUB_WORKSPACE/.deploy/k8s/k8s-manifest.demo.yaml | kubectl --context do-sfo2-k8s-gauzy apply -f -
env:
# below we are using GitHub secrets for both frontend and backend
CLOUD_PROVIDER: 'DO'
DB_NAME: 'gauzy_demo'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-do-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
DB_PORT: '${{ secrets.DB_PORT }}'
DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
DB_SSL_MODE: '${{ secrets.DB_SSL_MODE }}'
CLOUD_PROVIDER: 'DO'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-do-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
DB_PORT: '${{ secrets.DB_PORT }}'
DB_CA_CERT: '${{ secrets.DB_CA_CERT }}'
DB_SSL_MODE: '${{ secrets.DB_SSL_MODE }}'
CLOUD_PROVIDER: 'DO'
SENTRY_DSN: '${{ secrets.SENTRY_DSN }}'
SENTRY_TRACES_SAMPLE_RATE: '${{ secrets.SENTRY_TRACES_SAMPLE_RATE }}'
SENTRY_HTTP_TRACING_ENABLED: '${{ secrets.SENTRY_HTTP_TRACING_ENABLED }}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,22 @@ <h6>{{ 'TIMESHEET.SCREENSHOTS.TIME_LOG' | translate }}</h6>
}}
</div>
</div>
<div>
<div class="mb-2">
<div class="subtitle">
{{ 'TIMESHEET.NOTES' | translate }}:
</div>
<div>
{{ timeLog?.description }}
</div>
</div>
<div class="mb-2" *ngIf="timeLog?.reason">
<div class="subtitle">
{{ 'TIMESHEET.REASON' | translate }}:
</div>
<div>
{{ timeLog?.reason }}
</div>
</div>
</div>
<div class="col-auto">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ <h4>
<div class="col-sm-3">
{{ 'TIMESHEET.MEMBER' | translate }}
</div>
<div class="col-sm-5">
<div class="col">
{{ 'TIMESHEET.PROJECT' | translate }}
</div>
<div class="col">
Expand All @@ -425,7 +425,7 @@ <h4>
class="avatar-dashboard"
></ngx-avatar>
</div>
<div class="col-sm-5 project-name">
<div class="col project-name">
{{ manualTime.project.name }}
</div>
<div class="col">
Expand Down
1 change: 1 addition & 0 deletions docker-compose.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ services:
DB_HOST: db
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
CLIENT_BASE_URL: ${CLIENT_BASE_URL:-http://localhost:4200}
CLOUD_PROVIDER: ${CLOUD_PROVIDER:-}
SENTRY_DSN: ${SENTRY_DSN:-}
SENTRY_HTTP_TRACING_ENABLED: ${SENTRY_HTTP_TRACING_ENABLED:-}
SENTRY_POSTGRES_TRACKING_ENABLED: ${SENTRY_POSTGRES_TRACKING_ENABLED:-}
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ services:
DB_HOST: db
API_BASE_URL: ${API_BASE_URL:-http://localhost:3000}
CLIENT_BASE_URL: ${CLIENT_BASE_URL:-http://localhost:4200}
CLOUD_PROVIDER: ${CLOUD_PROVIDER:-}
SENTRY_DSN: ${SENTRY_DSN:-}
SENTRY_HTTP_TRACING_ENABLED: ${SENTRY_HTTP_TRACING_ENABLED:-}
SENTRY_POSTGRES_TRACKING_ENABLED: ${SENTRY_POSTGRES_TRACKING_ENABLED:-}
Expand Down
17 changes: 16 additions & 1 deletion packages/core/src/bootstrap/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { Resource } from '@opentelemetry/resources';
import { NodeSDK } from '@opentelemetry/sdk-node';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';
import { environment as env } from '@gauzy/config';

// Important for Tracing:
// 1. Define env var - OTEL_EXPORTER_OTLP_HEADERS="signoz-access-token=<SIGNOZ_INGESTION_KEY>"
Expand All @@ -23,11 +24,25 @@ const exporterOptions = {

const traceExporter = new OTLPTraceExporter(exporterOptions);

let serviceName = 'Ever Gauzy API';

if (env.demo) {
serviceName = serviceName + ' DEMO';
} else if (env.envName == 'dev') {
serviceName = serviceName + ' DEV';
} else if (env.envName == 'prod') {
serviceName = serviceName + ' PROD';
}

if (process.env.CLOUD_PROVIDER) {
serviceName = serviceName + ' (' + process.env.CLOUD_PROVIDER.toUpperCase() + ')';
}

const sdk = new NodeSDK({
traceExporter,
instrumentations: [getNodeAutoInstrumentations()],
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'Ever Gauzy API'
[SemanticResourceAttributes.SERVICE_NAME]: serviceName
})
});

Expand Down

0 comments on commit 6355ca6

Please sign in to comment.