@vaharoni/devops 1.2.13 → 1.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-N7EX3HJH.js +139 -0
- package/dist/chunk-RZ46YYZZ.js +420 -0
- package/dist/chunk-WKP7EQNU.js +421 -0
- package/dist/devops.d.ts +0 -2
- package/dist/devops.js +3235 -91
- package/dist/index.d.ts +972 -4
- package/dist/index.js +67 -3
- package/dist/plugins.d.ts +95 -4
- package/dist/plugins.js +20 -6
- package/dist/src/target-templates/README.md +1 -0
- package/dist/src/target-templates/cluster-resource-options/README.md +2 -0
- package/dist/src/target-templates/cluster-resource-options/dns-test/dns-test.yaml +60 -0
- package/dist/src/target-templates/cluster-resource-options/milvus/production/milvus-values.yaml +2 -0
- package/dist/src/target-templates/cluster-resource-options/milvus/staging/milvus-values.yaml +2 -0
- package/dist/src/target-templates/cluster-resource-options/monitoring-ingress/monitoring-ingress.yaml +62 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/daily-operator-restart.yaml +54 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/PodDisruptionBudget.yaml +27 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/SGCluster.yaml +47 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/cluster/StackGres-alerts.yaml +191 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/06-SGDistributedLogs.yaml +11 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/07-SGObjectStorage.yaml +18 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/production/configurations/08-SGScript.yaml +12 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/stackgres-ui-ingress.yaml +35 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/staging/cluster/SGCluster.yaml +42 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/staging/configurations/07-SGObjectStorage.yaml +18 -0
- package/dist/src/target-templates/cluster-resource-options/postgres/staging/configurations/08-SGScript.yaml +12 -0
- package/dist/src/target-templates/cluster-resource-options/prefect/production/prefect-values.yaml +14 -0
- package/dist/src/target-templates/cluster-resource-options/prefect/staging/prefect-values.yaml +14 -0
- package/dist/src/target-templates/cluster-resource-options/redis/production/redis-values.yaml +20 -0
- package/dist/src/target-templates/cluster-resource-options/redis/staging/redis-values.yaml +8 -0
- package/dist/src/target-templates/infra-variants/README.md +2 -0
- package/dist/src/target-templates/infra-variants/digitalocean/.devops/config/constants.yaml +18 -0
- package/dist/src/target-templates/infra-variants/digitalocean/.github/workflows/k8s-build.yaml +91 -0
- package/dist/src/target-templates/infra-variants/gcloud/.devops/config/constants.yaml +15 -0
- package/dist/src/target-templates/infra-variants/gcloud/.devops/manifests/ingress.yaml.hb +22 -0
- package/dist/src/target-templates/infra-variants/gcloud/.github/workflows/k8s-build.yaml +95 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/config/constants.yaml +18 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/abandoned/harbor-values.yaml +30 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/abandoned/hcloud-config.yaml +134 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/cert-manager.yaml +25 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-cert.yaml +13 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-values.yaml +76 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/hcloud-config.yaml +113 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/ingress-nginx-annotations.yaml +49 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/ingress-nginx-configmap.yaml +8 -0
- package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/retain-storage-class.yaml +8 -0
- package/dist/src/target-templates/infra-variants/hetzner/.github/workflows/k8s-build.yaml +93 -0
- package/dist/src/target-templates/lang-variants-common/README.md +4 -0
- package/dist/src/target-templates/lang-variants-common/python/.cursor/rules/monorepo-python.mdc +56 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/config/images.yaml +89 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services/python-exec.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services/python-run.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/docker-images/python-services.Dockerfile +29 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/_index.yaml +21 -0
- package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/prefect.yaml.hb +63 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-data-pipeline/pyproject.toml +14 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-data-pipeline/src/example_data_pipeline/main.py +38 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/pyproject.toml +20 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/__init__.py +0 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/main.py +13 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/src/example_python/scripts.py +17 -0
- package/dist/src/target-templates/lang-variants-common/python/applications/example-python/tests/__init__.py +0 -0
- package/dist/src/target-templates/lang-variants-common/python/devopspy +3 -0
- package/dist/src/target-templates/lang-variants-common/python/libs/example-python-lib/pyproject.toml +11 -0
- package/dist/src/target-templates/lang-variants-common/python/libs/example-python-lib/src/example_python_lib/__init__.py +2 -0
- package/dist/src/target-templates/lang-variants-common/python/pyproject.toml +16 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.cursor/rules/monorepo-typescript.mdc +51 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/config/images.yaml +69 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/cloudrun.Dockerfile +31 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/common/docker-common.sh +23 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services/node-exec.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services/node-run.sh +8 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/docker-images/node-services.Dockerfile +31 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/env.example.yaml +23 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/_index.yaml +19 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/cron-jobs.yaml.hb +56 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/db-migrate-job.yaml.hb +43 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-debug.yaml.hb +42 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-process.yaml.hb +48 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/deployment-web.yaml.hb +54 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/ingress.yaml.hb +21 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.devops/manifests/service.yaml.hb +15 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.envrc +5 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/build-image@v1/action.yaml +81 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-digital-ocean@v1/action.yaml +29 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-gke@v1/action.yaml +43 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/connect-to-hetzner@v1/action.yaml +31 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/db-migrate@v1/action.yaml +23 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/deploy-image-cloudrun@v1/action.yaml +71 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/deploy-image-k8s@v1/action.yaml +37 -0
- package/dist/src/target-templates/lang-variants-common/typescript/.github/actions/setup-prereq@v1/action.yaml +24 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/index.ts +30 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/package.json +26 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/example-node/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/README.md +68 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/index.ts +1 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/package.json +30 -0
- package/dist/src/target-templates/lang-variants-common/typescript/applications/jobs/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/config/.env.development +1 -0
- package/dist/src/target-templates/lang-variants-common/typescript/config/.env.global +4 -0
- package/dist/src/target-templates/lang-variants-common/typescript/config/.env.test +1 -0
- package/dist/src/target-templates/lang-variants-common/typescript/devops +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/index.ts +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/package.json +12 -0
- package/dist/src/target-templates/lang-variants-common/typescript/libs/example-node-lib/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-common/typescript/tmp/.gitkeep +0 -0
- package/dist/src/target-templates/lang-variants-common/typescript/tsconfig.json +27 -0
- package/dist/src/target-templates/lang-variants-prisma/README.md +3 -0
- package/dist/src/target-templates/lang-variants-prisma/python/.cursor/rules/prisma-python.mdc +55 -0
- package/dist/src/target-templates/lang-variants-prisma/python/.cursor/rules/testing-python.mdc +89 -0
- package/dist/src/target-templates/lang-variants-prisma/python/db/db/__init__.py +0 -0
- package/dist/src/target-templates/lang-variants-prisma/python/db/db/db_client_test.py +46 -0
- package/dist/src/target-templates/lang-variants-prisma/python/db/pyproject.toml +14 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/prisma-typescript.mdc +54 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/.cursor/rules/testing-typescript.mdc +103 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/db-client-test.ts +142 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/db-client.ts +19 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/env.yaml +4 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/package.json +17 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/prisma/schema.prisma +24 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/prisma-setup-vitest.ts +27 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/db/tsconfig.json +3 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/dml/package.json +7 -0
- package/dist/src/target-templates/lang-variants-prisma/typescript/dml/tsconfig.json +3 -0
- package/package.json +3 -2
- package/src/cli/core/exec.ts +2 -4
- package/src/cli/core/run.ts +2 -4
- package/src/cli/extensions/prisma.ts +2 -4
- package/src/libs/init-generator.ts +2 -4
- package/src/pkg-root.ts +14 -0
- package/src/plugins.ts +2 -4
- package/dist/app-support/crypto/aes.d.ts +0 -15
- package/dist/app-support/crypto/aes.d.ts.map +0 -1
- package/dist/app-support/crypto/aes.js +0 -56
- package/dist/app-support/crypto/aes.spec.d.ts +0 -2
- package/dist/app-support/crypto/aes.spec.d.ts.map +0 -1
- package/dist/app-support/crypto/aes.spec.js +0 -58
- package/dist/app-support/crypto/index.d.ts +0 -16
- package/dist/app-support/crypto/index.d.ts.map +0 -1
- package/dist/app-support/crypto/index.js +0 -31
- package/dist/app-support/crypto/internal-token.d.ts +0 -20
- package/dist/app-support/crypto/internal-token.d.ts.map +0 -1
- package/dist/app-support/crypto/internal-token.js +0 -42
- package/dist/app-support/crypto/internal-token.spec.d.ts +0 -2
- package/dist/app-support/crypto/internal-token.spec.d.ts.map +0 -1
- package/dist/app-support/crypto/internal-token.spec.js +0 -45
- package/dist/app-support/crypto/secret.d.ts +0 -3
- package/dist/app-support/crypto/secret.d.ts.map +0 -1
- package/dist/app-support/crypto/secret.js +0 -12
- package/dist/app-support/crypto/secret.spec.d.ts +0 -2
- package/dist/app-support/crypto/secret.spec.d.ts.map +0 -1
- package/dist/app-support/crypto/secret.spec.js +0 -15
- package/dist/app-support/discovery/dev-discovery-loader.d.ts +0 -2
- package/dist/app-support/discovery/dev-discovery-loader.d.ts.map +0 -1
- package/dist/app-support/discovery/dev-discovery-loader.js +0 -30
- package/dist/app-support/discovery/service-endpoint.d.ts +0 -2
- package/dist/app-support/discovery/service-endpoint.d.ts.map +0 -1
- package/dist/app-support/discovery/service-endpoint.js +0 -10
- package/dist/cli/common.d.ts +0 -89
- package/dist/cli/common.d.ts.map +0 -1
- package/dist/cli/common.js +0 -246
- package/dist/cli/common.spec.d.ts +0 -2
- package/dist/cli/common.spec.d.ts.map +0 -1
- package/dist/cli/common.spec.js +0 -64
- package/dist/cli/core/affected.d.ts +0 -9
- package/dist/cli/core/affected.d.ts.map +0 -1
- package/dist/cli/core/affected.js +0 -101
- package/dist/cli/core/cloudrun.d.ts +0 -9
- package/dist/cli/core/cloudrun.d.ts.map +0 -1
- package/dist/cli/core/cloudrun.js +0 -119
- package/dist/cli/core/console.d.ts +0 -10
- package/dist/cli/core/console.d.ts.map +0 -1
- package/dist/cli/core/console.js +0 -50
- package/dist/cli/core/constant.d.ts +0 -9
- package/dist/cli/core/constant.d.ts.map +0 -1
- package/dist/cli/core/constant.js +0 -20
- package/dist/cli/core/env.d.ts +0 -9
- package/dist/cli/core/env.d.ts.map +0 -1
- package/dist/cli/core/env.js +0 -65
- package/dist/cli/core/exec.d.ts +0 -9
- package/dist/cli/core/exec.d.ts.map +0 -1
- package/dist/cli/core/exec.js +0 -48
- package/dist/cli/core/image.d.ts +0 -9
- package/dist/cli/core/image.d.ts.map +0 -1
- package/dist/cli/core/image.js +0 -153
- package/dist/cli/core/index.d.ts +0 -16
- package/dist/cli/core/index.d.ts.map +0 -1
- package/dist/cli/core/index.js +0 -15
- package/dist/cli/core/init.d.ts +0 -9
- package/dist/cli/core/init.d.ts.map +0 -1
- package/dist/cli/core/init.js +0 -219
- package/dist/cli/core/job.d.ts +0 -9
- package/dist/cli/core/job.d.ts.map +0 -1
- package/dist/cli/core/job.js +0 -65
- package/dist/cli/core/namespace.d.ts +0 -9
- package/dist/cli/core/namespace.d.ts.map +0 -1
- package/dist/cli/core/namespace.js +0 -67
- package/dist/cli/core/prep-build.d.ts +0 -10
- package/dist/cli/core/prep-build.d.ts.map +0 -1
- package/dist/cli/core/prep-build.js +0 -109
- package/dist/cli/core/registry.d.ts +0 -9
- package/dist/cli/core/registry.d.ts.map +0 -1
- package/dist/cli/core/registry.js +0 -66
- package/dist/cli/core/run-many.d.ts +0 -10
- package/dist/cli/core/run-many.d.ts.map +0 -1
- package/dist/cli/core/run-many.js +0 -48
- package/dist/cli/core/run.d.ts +0 -9
- package/dist/cli/core/run.d.ts.map +0 -1
- package/dist/cli/core/run.js +0 -35
- package/dist/cli/core/test.d.ts +0 -9
- package/dist/cli/core/test.d.ts.map +0 -1
- package/dist/cli/core/test.js +0 -26
- package/dist/cli/extensions/dml.d.ts +0 -9
- package/dist/cli/extensions/dml.d.ts.map +0 -1
- package/dist/cli/extensions/dml.js +0 -114
- package/dist/cli/extensions/index.d.ts +0 -9
- package/dist/cli/extensions/index.d.ts.map +0 -1
- package/dist/cli/extensions/index.js +0 -8
- package/dist/cli/extensions/internal-curl.d.ts +0 -10
- package/dist/cli/extensions/internal-curl.d.ts.map +0 -1
- package/dist/cli/extensions/internal-curl.js +0 -41
- package/dist/cli/extensions/jwt.d.ts +0 -9
- package/dist/cli/extensions/jwt.d.ts.map +0 -1
- package/dist/cli/extensions/jwt.js +0 -25
- package/dist/cli/extensions/prisma.d.ts +0 -9
- package/dist/cli/extensions/prisma.d.ts.map +0 -1
- package/dist/cli/extensions/prisma.js +0 -23
- package/dist/cli/extensions/redis-bitnami.d.ts +0 -11
- package/dist/cli/extensions/redis-bitnami.d.ts.map +0 -1
- package/dist/cli/extensions/redis-bitnami.js +0 -74
- package/dist/cli/extensions/redis-ha.d.ts +0 -11
- package/dist/cli/extensions/redis-ha.d.ts.map +0 -1
- package/dist/cli/extensions/redis-ha.js +0 -51
- package/dist/cli/extensions/stackgres.d.ts +0 -10
- package/dist/cli/extensions/stackgres.d.ts.map +0 -1
- package/dist/cli/extensions/stackgres.js +0 -117
- package/dist/cli/extensions/template.d.ts +0 -9
- package/dist/cli/extensions/template.d.ts.map +0 -1
- package/dist/cli/extensions/template.js +0 -121
- package/dist/devops.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/libs/affected-entities.d.ts +0 -15
- package/dist/libs/affected-entities.d.ts.map +0 -1
- package/dist/libs/affected-entities.js +0 -52
- package/dist/libs/cloudrun-helpers.d.ts +0 -16
- package/dist/libs/cloudrun-helpers.d.ts.map +0 -1
- package/dist/libs/cloudrun-helpers.js +0 -81
- package/dist/libs/config.d.ts +0 -7
- package/dist/libs/config.d.ts.map +0 -1
- package/dist/libs/config.js +0 -102
- package/dist/libs/digital-ocean/container-reg.d.ts +0 -6
- package/dist/libs/digital-ocean/container-reg.d.ts.map +0 -1
- package/dist/libs/digital-ocean/container-reg.js +0 -74
- package/dist/libs/discovery/dependencies.d.ts +0 -19
- package/dist/libs/discovery/dependencies.d.ts.map +0 -1
- package/dist/libs/discovery/dependencies.js +0 -62
- package/dist/libs/discovery/dependencies.spec.d.ts +0 -2
- package/dist/libs/discovery/dependencies.spec.d.ts.map +0 -1
- package/dist/libs/discovery/dependencies.spec.js +0 -21
- package/dist/libs/discovery/images.d.ts +0 -5
- package/dist/libs/discovery/images.d.ts.map +0 -1
- package/dist/libs/discovery/images.js +0 -45
- package/dist/libs/discovery/index.d.ts +0 -6
- package/dist/libs/discovery/index.d.ts.map +0 -1
- package/dist/libs/discovery/index.js +0 -67
- package/dist/libs/discovery/process-common.d.ts +0 -25
- package/dist/libs/discovery/process-common.d.ts.map +0 -1
- package/dist/libs/discovery/process-common.js +0 -40
- package/dist/libs/discovery/process-package-json.d.ts +0 -3
- package/dist/libs/discovery/process-package-json.d.ts.map +0 -1
- package/dist/libs/discovery/process-package-json.js +0 -40
- package/dist/libs/discovery/process-pyproject-toml.d.ts +0 -3
- package/dist/libs/discovery/process-pyproject-toml.d.ts.map +0 -1
- package/dist/libs/discovery/process-pyproject-toml.js +0 -49
- package/dist/libs/git-helpers.d.ts +0 -8
- package/dist/libs/git-helpers.d.ts.map +0 -1
- package/dist/libs/git-helpers.js +0 -20
- package/dist/libs/hetzner/reg-secret.d.ts +0 -3
- package/dist/libs/hetzner/reg-secret.d.ts.map +0 -1
- package/dist/libs/hetzner/reg-secret.js +0 -39
- package/dist/libs/init-generator.d.ts +0 -41
- package/dist/libs/init-generator.d.ts.map +0 -1
- package/dist/libs/init-generator.js +0 -123
- package/dist/libs/k8s-constants.d.ts +0 -13
- package/dist/libs/k8s-constants.d.ts.map +0 -1
- package/dist/libs/k8s-constants.js +0 -91
- package/dist/libs/k8s-db.d.ts +0 -18
- package/dist/libs/k8s-db.d.ts.map +0 -1
- package/dist/libs/k8s-db.js +0 -73
- package/dist/libs/k8s-generate.d.ts +0 -17
- package/dist/libs/k8s-generate.d.ts.map +0 -1
- package/dist/libs/k8s-generate.js +0 -193
- package/dist/libs/k8s-helpers.d.ts +0 -11
- package/dist/libs/k8s-helpers.d.ts.map +0 -1
- package/dist/libs/k8s-helpers.js +0 -42
- package/dist/libs/k8s-image-config.d.ts +0 -8
- package/dist/libs/k8s-image-config.d.ts.map +0 -1
- package/dist/libs/k8s-image-config.js +0 -113
- package/dist/libs/k8s-job-waiter.d.ts +0 -8
- package/dist/libs/k8s-job-waiter.d.ts.map +0 -1
- package/dist/libs/k8s-job-waiter.js +0 -84
- package/dist/libs/k8s-namespace.d.ts +0 -7
- package/dist/libs/k8s-namespace.d.ts.map +0 -1
- package/dist/libs/k8s-namespace.js +0 -27
- package/dist/libs/k8s-redis-bitnami.d.ts +0 -6
- package/dist/libs/k8s-redis-bitnami.d.ts.map +0 -1
- package/dist/libs/k8s-redis-bitnami.js +0 -31
- package/dist/libs/k8s-redis-ha.d.ts +0 -3
- package/dist/libs/k8s-redis-ha.d.ts.map +0 -1
- package/dist/libs/k8s-redis-ha.js +0 -15
- package/dist/libs/k8s-secrets-manager.d.ts +0 -6
- package/dist/libs/k8s-secrets-manager.d.ts.map +0 -1
- package/dist/libs/k8s-secrets-manager.js +0 -64
- package/dist/libs/validate-env.d.ts +0 -56
- package/dist/libs/validate-env.d.ts.map +0 -1
- package/dist/libs/validate-env.js +0 -214
- package/dist/libs/validate-env.spec.d.ts +0 -2
- package/dist/libs/validate-env.spec.d.ts.map +0 -1
- package/dist/libs/validate-env.spec.js +0 -168
- package/dist/plugins.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -939
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -82
package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/harbor-values.yaml
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
expose:
|
|
2
|
+
type: ingress
|
|
3
|
+
ingress:
|
|
4
|
+
hosts:
|
|
5
|
+
core: $REGISTRY_BASE_URL
|
|
6
|
+
tls:
|
|
7
|
+
certSource: secret
|
|
8
|
+
secret:
|
|
9
|
+
secretName: tls-secret
|
|
10
|
+
externalURL: https://$REGISTRY_BASE_URL
|
|
11
|
+
persistence:
|
|
12
|
+
enabled: true
|
|
13
|
+
persistentVolumeClaim:
|
|
14
|
+
registry:
|
|
15
|
+
storageClass: "hcloud-volumes"
|
|
16
|
+
accessMode: ReadWriteOnce
|
|
17
|
+
size: 20Gi
|
|
18
|
+
jobservice:
|
|
19
|
+
storageClass: "hcloud-volumes"
|
|
20
|
+
accessMode: ReadWriteOnce
|
|
21
|
+
size: 5Gi
|
|
22
|
+
chartmuseum:
|
|
23
|
+
storageClass: "hcloud-volumes"
|
|
24
|
+
accessMode: ReadWriteOnce
|
|
25
|
+
size: 5Gi
|
|
26
|
+
database:
|
|
27
|
+
internal:
|
|
28
|
+
livenessProbe:
|
|
29
|
+
timeoutSeconds: 5
|
|
30
|
+
readinessProbe:
|
|
31
|
+
timeoutSeconds: 5
|
|
32
|
+
core:
|
|
33
|
+
livenessProbe:
|
|
34
|
+
initialDelaySeconds: 10
|
|
35
|
+
periodSeconds: 10
|
|
36
|
+
timeoutSeconds: 5
|
|
37
|
+
failureThreshold: 3
|
|
38
|
+
readinessProbe:
|
|
39
|
+
initialDelaySeconds: 5
|
|
40
|
+
periodSeconds: 10
|
|
41
|
+
timeoutSeconds: 5
|
|
42
|
+
failureThreshold: 3
|
|
43
|
+
jobservice:
|
|
44
|
+
livenessProbe:
|
|
45
|
+
initialDelaySeconds: 10
|
|
46
|
+
periodSeconds: 10
|
|
47
|
+
timeoutSeconds: 5
|
|
48
|
+
failureThreshold: 3
|
|
49
|
+
readinessProbe:
|
|
50
|
+
initialDelaySeconds: 5
|
|
51
|
+
periodSeconds: 10
|
|
52
|
+
timeoutSeconds: 5
|
|
53
|
+
failureThreshold: 3
|
|
54
|
+
registry:
|
|
55
|
+
registry:
|
|
56
|
+
livenessProbe:
|
|
57
|
+
initialDelaySeconds: 10
|
|
58
|
+
periodSeconds: 10
|
|
59
|
+
timeoutSeconds: 5
|
|
60
|
+
failureThreshold: 3
|
|
61
|
+
readinessProbe:
|
|
62
|
+
initialDelaySeconds: 5
|
|
63
|
+
periodSeconds: 10
|
|
64
|
+
timeoutSeconds: 5
|
|
65
|
+
failureThreshold: 3
|
|
66
|
+
controller:
|
|
67
|
+
livenessProbe:
|
|
68
|
+
initialDelaySeconds: 10
|
|
69
|
+
periodSeconds: 10
|
|
70
|
+
timeoutSeconds: 5
|
|
71
|
+
failureThreshold: 3
|
|
72
|
+
readinessProbe:
|
|
73
|
+
initialDelaySeconds: 5
|
|
74
|
+
periodSeconds: 10
|
|
75
|
+
timeoutSeconds: 5
|
|
76
|
+
failureThreshold: 3
|
package/dist/src/target-templates/infra-variants/hetzner/.devops/infra/hetzner/hcloud-config.yaml
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
cluster_name: $PROJECT_NAME
|
|
3
|
+
kubeconfig_path: "./config/kubeconfig"
|
|
4
|
+
k3s_version: v1.32.2+k3s1
|
|
5
|
+
|
|
6
|
+
networking:
|
|
7
|
+
ssh:
|
|
8
|
+
port: 22
|
|
9
|
+
use_agent: false # set to true if your key has a passphrase
|
|
10
|
+
public_key_path: "~/.ssh/id_hcloud.pub"
|
|
11
|
+
private_key_path: "~/.ssh/id_hcloud"
|
|
12
|
+
allowed_networks:
|
|
13
|
+
ssh:
|
|
14
|
+
- 0.0.0.0/0
|
|
15
|
+
api: # this will firewall port 6443 on the nodes
|
|
16
|
+
- 0.0.0.0/0
|
|
17
|
+
public_network:
|
|
18
|
+
ipv4: true
|
|
19
|
+
ipv6: true
|
|
20
|
+
private_network:
|
|
21
|
+
enabled: true
|
|
22
|
+
subnet: 10.0.0.0/16
|
|
23
|
+
existing_network_name: ""
|
|
24
|
+
cni:
|
|
25
|
+
enabled: true
|
|
26
|
+
encryption: false
|
|
27
|
+
mode: flannel
|
|
28
|
+
|
|
29
|
+
# cluster_cidr: 10.244.0.0/16 # optional: a custom IPv4/IPv6 network CIDR to use for pod IPs
|
|
30
|
+
# service_cidr: 10.43.0.0/16 # optional: a custom IPv4/IPv6 network CIDR to use for service IPs. Warning, if you change this, you should also change cluster_dns!
|
|
31
|
+
# cluster_dns: 10.43.0.10 # optional: IPv4 Cluster IP for coredns service. Needs to be an address from the service_cidr range
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# manifests:
|
|
35
|
+
# cloud_controller_manager_manifest_url: "https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases/download/v1.23.0/ccm-networks.yaml"
|
|
36
|
+
# csi_driver_manifest_url: "https://raw.githubusercontent.com/hetznercloud/csi-driver/v2.12.0/deploy/kubernetes/hcloud-csi.yml"
|
|
37
|
+
# system_upgrade_controller_deployment_manifest_url: "https://github.com/rancher/system-upgrade-controller/releases/download/v0.14.2/system-upgrade-controller.yaml"
|
|
38
|
+
# system_upgrade_controller_crd_manifest_url: "https://github.com/rancher/system-upgrade-controller/releases/download/v0.14.2/crd.yaml"
|
|
39
|
+
# cluster_autoscaler_manifest_url: "https://raw.githubusercontent.com/kubernetes/autoscaler/master/cluster-autoscaler/cloudprovider/hetzner/examples/cluster-autoscaler-run-on-master.yaml"
|
|
40
|
+
# cluster_autoscaler_container_image_tag: "v1.32.0"
|
|
41
|
+
|
|
42
|
+
# datastore:
|
|
43
|
+
# mode: etcd # etcd (default) or external
|
|
44
|
+
# external_datastore_endpoint: postgres://....
|
|
45
|
+
|
|
46
|
+
schedule_workloads_on_masters: false
|
|
47
|
+
|
|
48
|
+
# image: rocky-9 # optional: default is ubuntu-24.04
|
|
49
|
+
# autoscaling_image: 103908130 # optional, defaults to the `image` setting
|
|
50
|
+
# snapshot_os: microos # optional: specified the os type when using a custom snapshot
|
|
51
|
+
|
|
52
|
+
masters_pool:
|
|
53
|
+
instance_type: cpx21
|
|
54
|
+
instance_count: 1 # for HA; you can also create a single master cluster for dev and testing (not recommended for production)
|
|
55
|
+
locations: # You can choose a single location for single master clusters or if you prefer to have all masters in the same location. For regional clusters (which are only available in the eu-central network zone), each master needs to be placed in a separate location.
|
|
56
|
+
# - fsn1
|
|
57
|
+
# - hel1
|
|
58
|
+
- nbg1
|
|
59
|
+
|
|
60
|
+
worker_node_pools:
|
|
61
|
+
- name: small-static
|
|
62
|
+
instance_type: cx32
|
|
63
|
+
instance_count: 2
|
|
64
|
+
location: nbg1
|
|
65
|
+
# image: debian-11
|
|
66
|
+
# labels:
|
|
67
|
+
# - key: purpose
|
|
68
|
+
# value: blah
|
|
69
|
+
# taints:
|
|
70
|
+
# - key: something
|
|
71
|
+
# value: value1:NoSchedule
|
|
72
|
+
# - name: medium-autoscaled
|
|
73
|
+
# instance_type: cpx31
|
|
74
|
+
# location: fsn1
|
|
75
|
+
# autoscaling:
|
|
76
|
+
# enabled: true
|
|
77
|
+
# min_instances: 0
|
|
78
|
+
# max_instances: 3
|
|
79
|
+
|
|
80
|
+
embedded_registry_mirror:
|
|
81
|
+
enabled: false # Enables fast p2p distribution of container images between nodes for faster pod startup. Check if your k3s version is compatible before enabling this option. You can find more information at https://docs.k3s.io/installation/registry-mirror
|
|
82
|
+
|
|
83
|
+
protect_against_deletion: true
|
|
84
|
+
|
|
85
|
+
create_load_balancer_for_the_kubernetes_api: false # Just a heads up: right now, we can’t limit access to the load balancer by IP through the firewall. This feature hasn’t been added by Hetzner yet.
|
|
86
|
+
|
|
87
|
+
# additional_packages:
|
|
88
|
+
# - somepackage
|
|
89
|
+
|
|
90
|
+
# post_create_commands:
|
|
91
|
+
# - apt update
|
|
92
|
+
# - apt upgrade -y
|
|
93
|
+
# - apt autoremove -y
|
|
94
|
+
|
|
95
|
+
# kube_api_server_args:
|
|
96
|
+
# - arg1
|
|
97
|
+
# - ...
|
|
98
|
+
# kube_scheduler_args:
|
|
99
|
+
# - arg1
|
|
100
|
+
# - ...
|
|
101
|
+
# kube_controller_manager_args:
|
|
102
|
+
# - arg1
|
|
103
|
+
# - ...
|
|
104
|
+
# kube_cloud_controller_manager_args:
|
|
105
|
+
# - arg1
|
|
106
|
+
# - ...
|
|
107
|
+
# kubelet_args:
|
|
108
|
+
# - arg1
|
|
109
|
+
# - ...
|
|
110
|
+
# kube_proxy_args:
|
|
111
|
+
# - arg1
|
|
112
|
+
# - ...
|
|
113
|
+
# api_server_hostname: k8s.example.com # optional: DNS for the k8s API LoadBalancer. After the script has run, create a DNS record with the address of the API LoadBalancer.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# INSTALLATION
|
|
2
|
+
# 1. Install Helm: https://helm.sh/docs/intro/install/
|
|
3
|
+
# 2. Add ingress-nginx Helm repo: helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
|
|
4
|
+
# 3. Update information of available charts: helm repo update
|
|
5
|
+
# 4. Install ingress-nginx:
|
|
6
|
+
# helm upgrade --install \
|
|
7
|
+
# ingress-nginx ingress-nginx/ingress-nginx \
|
|
8
|
+
# --set controller.ingressClassResource.default=true \ # Remove this line if you don’t want Nginx to be the default Ingress Controller
|
|
9
|
+
# -f ./ingress-nginx-annotations.yaml \
|
|
10
|
+
# --namespace ingress-nginx \
|
|
11
|
+
# --create-namespace
|
|
12
|
+
|
|
13
|
+
# LIST of all ANNOTATIONS: https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/master/internal/annotation/load_balancer.go
|
|
14
|
+
|
|
15
|
+
controller:
|
|
16
|
+
kind: DaemonSet
|
|
17
|
+
service:
|
|
18
|
+
annotations:
|
|
19
|
+
# Germany:
|
|
20
|
+
# - nbg1 (Nuremberg)
|
|
21
|
+
# - fsn1 (Falkenstein)
|
|
22
|
+
# Finland:
|
|
23
|
+
# - hel1 (Helsinki)
|
|
24
|
+
# USA:
|
|
25
|
+
# - ash (Ashburn, Virginia)
|
|
26
|
+
# Without this, the load balancer won’t be provisioned and will stay in "pending" state.
|
|
27
|
+
# You can check this state using "kubectl get svc -n ingress-nginx"
|
|
28
|
+
load-balancer.hetzner.cloud/location: nbg1
|
|
29
|
+
|
|
30
|
+
# Name of the load balancer. This name will appear in your Hetzner cloud console under "Your project -> Load Balancers".
|
|
31
|
+
# NOTE: This is NOT the load balancer created automatically for HA clusters. You need to specify a different name here to create a separate load balancer for ingress Nginx.
|
|
32
|
+
load-balancer.hetzner.cloud/name: ingress-lb
|
|
33
|
+
|
|
34
|
+
# Ensures communication between the load balancer and cluster nodes happens through the private network.
|
|
35
|
+
load-balancer.hetzner.cloud/use-private-ip: "true"
|
|
36
|
+
|
|
37
|
+
# [ START: Use these annotations if you care about seeing the actual client IP ]
|
|
38
|
+
# "uses-proxyprotocol" enables the proxy protocol on the load balancer so that the ingress controller and applications can see the real client IP.
|
|
39
|
+
# "hostname" is needed if you use cert-manager (LetsEncrypt SSL certificates). It fixes HTTP01 challenges for cert-manager (https://cert-manager.io/docs/).
|
|
40
|
+
# Check this link for more details: https://github.com/compumike/hairpin-proxy
|
|
41
|
+
# In short: the easiest fix provided by some providers (including Hetzner) is to configure the load balancer to use a hostname instead of an IP.
|
|
42
|
+
load-balancer.hetzner.cloud/uses-proxyprotocol: 'true'
|
|
43
|
+
|
|
44
|
+
# 1. "yourDomain.com" must be correctly configured in DNS to point to the Nginx load balancer; otherwise, certificate provisioning won’t work.
|
|
45
|
+
# 2. If you use multiple domains, specify any one.
|
|
46
|
+
# load-balancer.hetzner.cloud/hostname: yourDomain.com
|
|
47
|
+
# [ END: Use these annotations if you care about seeing the actual client IP ]
|
|
48
|
+
|
|
49
|
+
load-balancer.hetzner.cloud/http-redirect-https: 'false'
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
name: "Monorepo Build and Deploy"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- staging
|
|
7
|
+
- production
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
packages: read
|
|
12
|
+
# For deploying images to Cloud Run
|
|
13
|
+
# id-token: write
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
build_images:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
include:
|
|
21
|
+
- image_name: main-node
|
|
22
|
+
- image_name: main-python
|
|
23
|
+
cache_path: /root/.cache/uv
|
|
24
|
+
steps:
|
|
25
|
+
# Fetch the last 50 commits so that devops affected works
|
|
26
|
+
- name: Checkout repo and history
|
|
27
|
+
uses: actions/checkout@v4
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 50
|
|
30
|
+
|
|
31
|
+
- name: Setup prerequesites
|
|
32
|
+
uses: ./.github/actions/setup-prereq@v1
|
|
33
|
+
|
|
34
|
+
- name: Connect to Hetzner
|
|
35
|
+
uses: ./.github/actions/connect-to-hetzner@v1
|
|
36
|
+
with:
|
|
37
|
+
kubeconfig: ${{ secrets.HCLOUD_KUBECONFIG }}
|
|
38
|
+
harbor_user: ${{ secrets.HARBOR_USER }}
|
|
39
|
+
harbor_password: ${{ secrets.HARBOR_PASSWORD }}
|
|
40
|
+
|
|
41
|
+
# For deploying images to Cloud Run
|
|
42
|
+
# - name: Connect to Cloud Run
|
|
43
|
+
# uses: ./.github/actions/connect-to-cloud-run@v1
|
|
44
|
+
# with:
|
|
45
|
+
# project_id: ${{ vars.GCP_PROJECT_ID }}
|
|
46
|
+
# project_number: ${{ vars.GCP_PROJECT_NUMBER }}
|
|
47
|
+
# region: ${{ vars.GCP_ARTIFACT_REGISTRY_REGION }}
|
|
48
|
+
|
|
49
|
+
- name: Build image
|
|
50
|
+
uses: ./.github/actions/build-image@v1
|
|
51
|
+
with:
|
|
52
|
+
image_name: ${{ matrix.image_name }}
|
|
53
|
+
cache_path: ${{ matrix.cache_path || '/root/.bun/install/cache' }}
|
|
54
|
+
|
|
55
|
+
db_migrate_and_deploy:
|
|
56
|
+
needs: [build_images]
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
# Fetch the last 50 commits so that devops affected works
|
|
60
|
+
- name: Checkout repo and history
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
with:
|
|
63
|
+
fetch-depth: 50
|
|
64
|
+
|
|
65
|
+
- name: Setup prerequesites
|
|
66
|
+
uses: ./.github/actions/setup-prereq@v1
|
|
67
|
+
|
|
68
|
+
- name: Connect to Hetzner
|
|
69
|
+
uses: ./.github/actions/connect-to-hetzner@v1
|
|
70
|
+
with:
|
|
71
|
+
kubeconfig: ${{ secrets.HCLOUD_KUBECONFIG }}
|
|
72
|
+
harbor_user: ${{ secrets.HARBOR_USER }}
|
|
73
|
+
harbor_password: ${{ secrets.HARBOR_PASSWORD }}
|
|
74
|
+
|
|
75
|
+
# For deploying images to Cloud Run
|
|
76
|
+
# - name: Connect to Cloud Run
|
|
77
|
+
# uses: ./.github/actions/connect-to-cloud-run@v1
|
|
78
|
+
# with:
|
|
79
|
+
# project_id: ${{ vars.GCP_PROJECT_ID }}
|
|
80
|
+
# project_number: ${{ vars.GCP_PROJECT_NUMBER }}
|
|
81
|
+
# region: ${{ vars.GCP_ARTIFACT_REGISTRY_REGION }}
|
|
82
|
+
|
|
83
|
+
- name: Run DB Migrate
|
|
84
|
+
uses: ./.github/actions/db-migrate@v1
|
|
85
|
+
|
|
86
|
+
# Repeat per image (it checks if the image is affected and deploys it if it is)
|
|
87
|
+
- name: Deploy main node
|
|
88
|
+
uses: ./.github/actions/deploy-image-k8s@v1
|
|
89
|
+
with: { "image_name": "main-node" }
|
|
90
|
+
|
|
91
|
+
- name: Deploy main python
|
|
92
|
+
uses: ./.github/actions/deploy-image-k8s@v1
|
|
93
|
+
with: { "image_name": "main-python" }
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
All files under `typescript` are copied under the root project folder.
|
|
2
|
+
|
|
3
|
+
During `./devops init`, the user is asked whether python-related files should be added to the repository.
|
|
4
|
+
If the user answers positively, the files under the `python` folder are also copied, overriding files with the same path.
|
package/dist/src/target-templates/lang-variants-common/python/.cursor/rules/monorepo-python.mdc
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
alwaysApply: true
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Python Monorepo
|
|
6
|
+
|
|
7
|
+
This project includes a Python workspace alongside the TypeScript workspace.
|
|
8
|
+
|
|
9
|
+
- **`./devops`** is for TypeScript/Node packages (package.json tree)
|
|
10
|
+
- **`./devopspy`** is for Python packages (pyproject.toml tree)
|
|
11
|
+
|
|
12
|
+
The Python workspace is configured through a root `pyproject.toml` using uv workspaces.
|
|
13
|
+
|
|
14
|
+
## Structure
|
|
15
|
+
|
|
16
|
+
Packages under `applications` depend on packages under `libs` using workspace dependencies. It makes sense to extract code to packages under `libs` when it is used in more than one application. Applications never rely on other applications.
|
|
17
|
+
|
|
18
|
+
All web services found under `applications` should respond to a `GET healthz` with status 200.
|
|
19
|
+
|
|
20
|
+
## Using the devopspy CLI (Python only)
|
|
21
|
+
|
|
22
|
+
We use `uv` as our package manager. The `./devopspy` script is able to run scripts defined in pyproject.toml inside a workspace, run a shell process inside a workspace, and execute the tests in a project:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Most important commands
|
|
26
|
+
./devopspy run <project-name>:<script-name>
|
|
27
|
+
./devopspy exec --in <project-name> <command>
|
|
28
|
+
./devopspy test
|
|
29
|
+
./devopspy test <project-name>
|
|
30
|
+
|
|
31
|
+
# Examples
|
|
32
|
+
./devopspy run my-api:dev
|
|
33
|
+
./devopspy exec --in my-api uv add some-package
|
|
34
|
+
./devopspy test my-service
|
|
35
|
+
|
|
36
|
+
# To sync dependencies on all workspaces in the monorepo, use uv normally
|
|
37
|
+
uv sync
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Scripts are defined in pyproject.toml under `[tool.devops.scripts]`:
|
|
41
|
+
|
|
42
|
+
```toml
|
|
43
|
+
[tool.devops.scripts]
|
|
44
|
+
dev = "python -c 'from src.my_package.scripts import dev; dev()'"
|
|
45
|
+
start = "python -c 'from src.my_package.scripts import start; start()'"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`./devopspy` automatically loads the right env variables, so don't use python-dotenv.
|
|
49
|
+
|
|
50
|
+
There is no need to `cd` into package directories. Prefer to use `./devopspy run` and `./devopspy exec`.
|
|
51
|
+
|
|
52
|
+
## Testing
|
|
53
|
+
|
|
54
|
+
Use pytest.
|
|
55
|
+
|
|
56
|
+
**Always run tests with `./devopspy test`** to ensure the test environment is used.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# The file structure is as follows:
|
|
2
|
+
#
|
|
3
|
+
# Under `templates` key:
|
|
4
|
+
# <template-key>:
|
|
5
|
+
# copy-common: <boolean>
|
|
6
|
+
# extra-content:
|
|
7
|
+
# - <file-name>
|
|
8
|
+
# - <file-name>
|
|
9
|
+
#
|
|
10
|
+
# Where:
|
|
11
|
+
# <template-key> The identifier of the template.
|
|
12
|
+
# This is used to refer to the template in the images section.
|
|
13
|
+
# copy-common Whether to copy the common Docker files from .devops/docker-images/common to the image.
|
|
14
|
+
# extra-content Any files to include in the image that are not part of the build context. By default, all applications and their dependencies are copied, as well as the
|
|
15
|
+
# content of .devops/docker-images/<image-name>. If you need to include additional files, list them here. These are typically from the root of the project.
|
|
16
|
+
# Files and full folders are supported. Globs (wildcards) are currently not supported.
|
|
17
|
+
#
|
|
18
|
+
#
|
|
19
|
+
# Under `images` key:
|
|
20
|
+
# <image-key>:
|
|
21
|
+
# image-template: <image-template>
|
|
22
|
+
# language: <language>
|
|
23
|
+
# debug-template: <debug-template>
|
|
24
|
+
# can-db-migrate: <boolean>
|
|
25
|
+
# domains:
|
|
26
|
+
# production: <production-domain>
|
|
27
|
+
# staging: <staging-domain>
|
|
28
|
+
# image-extra-content:
|
|
29
|
+
# - <file-name>
|
|
30
|
+
# - <file-name>
|
|
31
|
+
# applications:
|
|
32
|
+
# - <application-name>
|
|
33
|
+
# - <application-name>
|
|
34
|
+
#
|
|
35
|
+
# Where:
|
|
36
|
+
# <image-name> The identifier of the image. Github action should refer to this name in a hard-coded manner when invoking devops scripts.
|
|
37
|
+
# This is also the basis for the name of the image in the registry.
|
|
38
|
+
# image-template The build process copies .devops/docker-images/<image-template>.Dockerfile and .devops/docker-images/<image-template>/ to the image.
|
|
39
|
+
# language The language of the image. Currently only "node" and "python" are supported.
|
|
40
|
+
# debug-template Each image comes with a debug pod that can be acccessed as a console. This is the name of the template to use.
|
|
41
|
+
# Only "debug-console" is currently supported. Can be left out if the image should not have a debug pod.
|
|
42
|
+
# can-db-migrate Whether this image can be used to run DB migrations. If set to true, the image could be used to run DB migrations if any project that uses this image depends
|
|
43
|
+
# on the db project and if the db project changed.
|
|
44
|
+
# domains The domains for the image. This is used to generate the ingress rules.
|
|
45
|
+
# This can be left out if the image does not have ingress rules, such as a worker image.
|
|
46
|
+
# cloudrun If this image should be pushed to cloudrun instead of the cluster registry, set to "true".
|
|
47
|
+
# applications List of applications that use this image. There is no need to specify dependencies - they will be derived as long as they are declared in package.json.
|
|
48
|
+
#
|
|
49
|
+
|
|
50
|
+
templates:
|
|
51
|
+
node-services:
|
|
52
|
+
copy-common: true
|
|
53
|
+
extra-content:
|
|
54
|
+
- devops
|
|
55
|
+
- package.json
|
|
56
|
+
- bun.lock
|
|
57
|
+
- tsconfig.json
|
|
58
|
+
|
|
59
|
+
python-services:
|
|
60
|
+
copy-common: true
|
|
61
|
+
extra-content:
|
|
62
|
+
- devopspy
|
|
63
|
+
- pyproject.toml
|
|
64
|
+
- uv.lock
|
|
65
|
+
|
|
66
|
+
images:
|
|
67
|
+
main-node:
|
|
68
|
+
image-template: node-services
|
|
69
|
+
language: node
|
|
70
|
+
debug-template: debug-console
|
|
71
|
+
can-db-migrate: true
|
|
72
|
+
domains:
|
|
73
|
+
production: $PRODUCTION_DOMAIN
|
|
74
|
+
staging: $STAGING_DOMAIN
|
|
75
|
+
applications:
|
|
76
|
+
- example-node
|
|
77
|
+
- jobs
|
|
78
|
+
|
|
79
|
+
main-python:
|
|
80
|
+
image-template: python-services
|
|
81
|
+
language: python
|
|
82
|
+
debug-template: debug-console
|
|
83
|
+
can-db-migrate: false
|
|
84
|
+
domains:
|
|
85
|
+
production: $PRODUCTION_DOMAIN
|
|
86
|
+
staging: $STAGING_DOMAIN
|
|
87
|
+
applications:
|
|
88
|
+
- example-python
|
|
89
|
+
- example-data-pipeline
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
|
|
2
|
+
|
|
3
|
+
ENV UV_SYSTEM_PYTHON=1
|
|
4
|
+
ENV PATH="/root/.local/bin:$PATH"
|
|
5
|
+
|
|
6
|
+
WORKDIR /app
|
|
7
|
+
|
|
8
|
+
ARG MONOREPO_ENV
|
|
9
|
+
ENV MONOREPO_ENV=${MONOREPO_ENV}
|
|
10
|
+
RUN echo "Building for environment: $MONOREPO_ENV"
|
|
11
|
+
|
|
12
|
+
# Install dependencies
|
|
13
|
+
RUN apt-get update && apt-get install -y jq libpq-dev curl git parallel --fix-missing
|
|
14
|
+
|
|
15
|
+
# Copy project files
|
|
16
|
+
COPY . .
|
|
17
|
+
|
|
18
|
+
RUN \
|
|
19
|
+
--mount=type=cache,target=/root/.cache/uv \
|
|
20
|
+
uv sync --all-packages --all-extras
|
|
21
|
+
|
|
22
|
+
# For prisma client, if used
|
|
23
|
+
RUN ./devopspy run-many generate
|
|
24
|
+
RUN ./devopspy run-many build
|
|
25
|
+
|
|
26
|
+
# The config folder will be mounted when the pod starts with up-to-date env variables that are used in runtime by server-side code
|
|
27
|
+
RUN rm -rf config/
|
|
28
|
+
|
|
29
|
+
ENTRYPOINT [ "./python-run.sh" ]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# db-migrate is a required entry that is hard-coded in the devops-cli
|
|
2
|
+
# The debug template used per image is dynamic and can be configured in images.yaml
|
|
3
|
+
# The deployment template used per application is dynamic and can be configured in its package.json
|
|
4
|
+
|
|
5
|
+
db-migrate:
|
|
6
|
+
- db-migrate-job.yaml.hb
|
|
7
|
+
debug-console:
|
|
8
|
+
- deployment-debug.yaml.hb
|
|
9
|
+
cron-jobs:
|
|
10
|
+
- cron-jobs.yaml.hb
|
|
11
|
+
backend-process:
|
|
12
|
+
- deployment-process.yaml.hb
|
|
13
|
+
internal-service:
|
|
14
|
+
- deployment-web.yaml.hb
|
|
15
|
+
- service.yaml.hb
|
|
16
|
+
external-service:
|
|
17
|
+
- deployment-web.yaml.hb
|
|
18
|
+
- service.yaml.hb
|
|
19
|
+
- ingress.yaml.hb
|
|
20
|
+
prefect:
|
|
21
|
+
- prefect.yaml.hb
|
package/dist/src/target-templates/lang-variants-common/python/.devops/manifests/prefect.yaml.hb
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{{#each prefectFlows}}
|
|
2
|
+
apiVersion: apps/v1
|
|
3
|
+
kind: Deployment
|
|
4
|
+
metadata:
|
|
5
|
+
labels:
|
|
6
|
+
app: {{../app_name}}
|
|
7
|
+
env: {{../monorepo_env}}
|
|
8
|
+
name: {{../app_name}}-{{flow_name}}
|
|
9
|
+
namespace: {{../namespace}}
|
|
10
|
+
spec:
|
|
11
|
+
replicas: 1
|
|
12
|
+
selector:
|
|
13
|
+
matchLabels:
|
|
14
|
+
app: {{../app_name}}
|
|
15
|
+
template:
|
|
16
|
+
metadata:
|
|
17
|
+
labels:
|
|
18
|
+
app: {{../app_name}}
|
|
19
|
+
env: {{../monorepo_env}}
|
|
20
|
+
spec:
|
|
21
|
+
volumes:
|
|
22
|
+
- name: secret-injection-hook
|
|
23
|
+
secret:
|
|
24
|
+
secretName: {{../env_secret_name}}
|
|
25
|
+
containers:
|
|
26
|
+
- image: {{../image_path}}
|
|
27
|
+
name: {{flow_name}}
|
|
28
|
+
command:
|
|
29
|
+
- ./python-exec.sh
|
|
30
|
+
args:
|
|
31
|
+
- ./devopspy
|
|
32
|
+
- exec
|
|
33
|
+
- --in
|
|
34
|
+
- {{../app_name}}
|
|
35
|
+
- python
|
|
36
|
+
- -m
|
|
37
|
+
- {{script_path}}
|
|
38
|
+
env:
|
|
39
|
+
- name: PREFECT_API_URL
|
|
40
|
+
value: http://prefect-server.prefect-{{../monorepo_env}}:4200/api
|
|
41
|
+
- name: MONOREPO_ENV
|
|
42
|
+
value: {{../monorepo_env}}
|
|
43
|
+
- name: MONOREPO_NAMESPACE
|
|
44
|
+
value: {{../namespace}}
|
|
45
|
+
- name: IS_KUBERNETES
|
|
46
|
+
value: 'true'
|
|
47
|
+
- name: MONOREPO_BASE_SECRET
|
|
48
|
+
valueFrom:
|
|
49
|
+
secretKeyRef:
|
|
50
|
+
name: {{../env_secret_name}}
|
|
51
|
+
key: {{../env_base_secret_key}}
|
|
52
|
+
volumeMounts:
|
|
53
|
+
- name: secret-injection-hook
|
|
54
|
+
mountPath: /etc/kubernetes/secrets
|
|
55
|
+
readOnly: true
|
|
56
|
+
resources:
|
|
57
|
+
requests:
|
|
58
|
+
memory: 250Mi
|
|
59
|
+
cpu: 250m
|
|
60
|
+
{{#unless @last}}
|
|
61
|
+
---
|
|
62
|
+
{{/unless}}
|
|
63
|
+
{{/each}}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "example-data-pipeline"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = ""
|
|
5
|
+
authors = []
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
dependencies = ["prefect (>=3.2.14,<4.0.0)"]
|
|
8
|
+
|
|
9
|
+
[tool.devops.deployment]
|
|
10
|
+
template = "prefect"
|
|
11
|
+
|
|
12
|
+
[[tool.devops.deployment.prefectFlows]]
|
|
13
|
+
flow_name = "test-flow"
|
|
14
|
+
script_path = "src.example_data_pipeline.main"
|