diff --git a/.github/environments/disabled/config.yml b/.github/environments/disabled/config.yml new file mode 100644 index 00000000..a6bde126 --- /dev/null +++ b/.github/environments/disabled/config.yml @@ -0,0 +1,26 @@ +DRYDOCK_INIT_JOBS: true +K8S_NAMESPACE: testing-openedx +PLUGINS: +- forum +- mfe +- drydock +DRYDOCK_BYPASS_CADDY: false +DRYDOCK_FLOWER: false +DRYDOCK_INGRESS: false +DRYDOCK_DEBUG: false +DRYDOCK_ENABLE_CELERY_TUNING: false +DRYDOCK_ENABLE_MULTITENANCY: false +DRYDOCK_ENABLE_SCORM: false +DRYDOCK_ENABLE_SENTRY: false +DRYDOCK_POD_LIFECYCLE: false +DRYDOCK_AUTO_TLS: false +DRYDOCK_NEWRELIC_LICENSE_KEY: "" +DRYDOCK_INGRESS_LMS_EXTRA_HOSTS: [] +DRYDOCK_INGRESS_EXTRA_HOSTS: [] +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_MFE: 0 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_FORUM: 0 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CADDY: 0 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS: 0 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS_WORKER: 0 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS: 0 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS_WORKER: 0 diff --git a/.github/environments/enabled/config.yml b/.github/environments/enabled/config.yml new file mode 100644 index 00000000..35ba58a1 --- /dev/null +++ b/.github/environments/enabled/config.yml @@ -0,0 +1,32 @@ +DRYDOCK_INIT_JOBS: true +K8S_NAMESPACE: testing-openedx +PLUGINS: +- forum +- mfe +- drydock +- s3 +DRYDOCK_BYPASS_CADDY: true +DRYDOCK_FLOWER: true +DRYDOCK_INGRESS: true +DRYDOCK_DEBUG: true +DRYDOCK_ENABLE_CELERY_TUNING: true +DRYDOCK_ENABLE_MULTITENANCY: true +DRYDOCK_ENABLE_SCORM: true +DRYDOCK_ENABLE_SENTRY: true +DRYDOCK_POD_LIFECYCLE: true +DRYDOCK_AUTO_TLS: true +DRYDOCK_NEWRELIC_LICENSE_KEY: "your_newrelic_license_key" +DRYDOCK_INGRESS_LMS_EXTRA_HOSTS: +- "lms1.testing.example.com" +- "lms2.testing.example.com" +DRYDOCK_INGRESS_EXTRA_HOSTS: +- "superset.testing.example.com" +- "forum.testing.example.com" +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_MFE: 50 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_FORUM: 50 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CADDY: 50 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS: 50 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_LMS_WORKER: 50 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS: 50 +DRYDOCK_PDB_MINAVAILABLE_PERCENTAGE_CMS_WORKER: 50 +DRYDOCK_MIGRATE_FROM: 13 diff --git a/.github/environments/minio_enabled/config.yml b/.github/environments/minio_enabled/config.yml new file mode 100644 index 00000000..cc5a5a88 --- /dev/null +++ b/.github/environments/minio_enabled/config.yml @@ -0,0 +1,15 @@ +DRYDOCK_INIT_JOBS: true +K8S_NAMESPACE: testing-openedx +PLUGINS: +- mfe +- drydock +- minio +DRYDOCK_BYPASS_CADDY: true +DRYDOCK_INGRESS: true +DRYDOCK_ENABLE_SCORM: true +DRYDOCK_INGRESS_LMS_EXTRA_HOSTS: +- "lms1.testing.example.com" +- "lms2.testing.example.com" +DRYDOCK_INGRESS_EXTRA_HOSTS: +- "superset.testing.example.com" +- "forum.testing.example.com" diff --git a/.github/requirements.txt b/.github/requirements.txt new file mode 100644 index 00000000..63474c0a --- /dev/null +++ b/.github/requirements.txt @@ -0,0 +1,3 @@ +tutor[full]<18 +setuptools +git+https://github.com/hastexo/tutor-contrib-s3@v1.4.0 diff --git a/.github/workflows/kubeconform-validation.yml b/.github/workflows/kubeconform-validation.yml new file mode 100644 index 00000000..bcec0fdf --- /dev/null +++ b/.github/workflows/kubeconform-validation.yml @@ -0,0 +1,47 @@ +name: Kubeconform Validation + +on: + pull_request: + +jobs: + load-environments: + name: Load environments + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@v2 + - id: set-matrix + run: echo "::set-output name=matrix::$(ls .github/environments/ | jq -R -s -c 'split("\n")[:-1]')" + validation: + needs: load-environments + strategy: + matrix: + environment: ${{fromJson(needs.load-environments.outputs.matrix)}} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: setup python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Setup Tutor environment + run: | + echo "TUTOR_ROOT=$GITHUB_WORKSPACE/.github/environments/${{ matrix.environment }}" >> $GITHUB_ENV + echo "TUTOR_PLUGINS_ROOT=$TUTOR_ROOT/plugins" >> $GITHUB_ENV + - name: Install python reqs + run: | + pip install -r .github/requirements.txt + pip install -e . + - name: Tutor config save + run: tutor config save + - name: Install Kubernetes tools + uses: alexellis/arkade-get@master + with: + kubectl: latest + kustomize: latest + kubeconform: latest + - name: Check k8s manifests + run: | + kustomize build $TUTOR_ROOT/env | kubeconform -strict -ignore-missing-schemas -kubernetes-version latest diff --git a/drydock/patches/caddyfile-cms b/drydock/patches/caddyfile-cms index 6caababd..36e638e4 100644 --- a/drydock/patches/caddyfile-cms +++ b/drydock/patches/caddyfile-cms @@ -18,3 +18,4 @@ route @scorm_matcher { header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com } } +{% endif %} diff --git a/drydock/patches/caddyfile-lms b/drydock/patches/caddyfile-lms index 6caababd..36e638e4 100644 --- a/drydock/patches/caddyfile-lms +++ b/drydock/patches/caddyfile-lms @@ -18,3 +18,4 @@ route @scorm_matcher { header_up Host {{ S3_STORAGE_BUCKET }}.s3.amazonaws.com } } +{% endif %}