-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
146 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Integration Test | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
k8s: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cluster: | ||
- cluster-01 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: start minikube | ||
id: minikube | ||
uses: medyagh/setup-minikube@latest | ||
|
||
- name: Setup namespace | ||
run: | | ||
kubectl config set-context --current --namespace=openedx-harmony | ||
- name: Helm dependency add | ||
run: | | ||
helm dependency list charts/harmony-chart 2> /dev/null | tail +2 | awk '{ print "helm" " repo add " $1 " " $3 }' | while read cmd; do $cmd || true; done | ||
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.crds.yaml --namespace=harmony | ||
- name: Helm dependency build | ||
run: | | ||
helm dependency update charts/harmony-chart | ||
helm dependency build charts/harmony-chart | ||
- name: Helm install | ||
run: | | ||
helm install harmony --namespace harmony --create-namespace -f integration-test/${{matrix.cluster}}/values.yaml charts/harmony-chart | ||
- name: Setup domain | ||
run: | | ||
export CLUSTER_HTTP_URL=$(minikube service harmony-ingress-nginx-controller -n harmony --url | head -n 1) | ||
curl $CLUSTER_HTTP_URL/cluster-echo-test -H "host: harmony.test" | ||
- name: setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install openedx | ||
run: | | ||
export INSTALLATIONS=$(ls -d integration-test/${{matrix.cluster}}/*/) | ||
export CI_ROOT=$(pwd) | ||
for i in $(ls -d integration-test/cluster-01/*/) | ||
do | ||
echo "Running for installation $i" | ||
cd $i | ||
export TUTOR_PLUGINS_ROOT=$(pwd)/plugins/ export TUTOR_ROOT=$(pwd) | ||
python3 -m venv venv && source venv/bin/activate | ||
pip install -r $TUTOR_ROOT/requirements.txt | ||
tutor config save | ||
tutor plugins enable k8s_harmony | ||
tutor k8s start | ||
tutor k8s init | ||
cd $CI_ROOT | ||
deactivate | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
install: # Run any arbitrary commands necessary to prepare your installation | ||
echo "Hi, running from $(pwd)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
K8S_NAMESPACE: openedx-01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
../../../tutor-contrib-harmony-plugin | ||
tutor[full]<19 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Disable HTTPS cert provisioning for testing with minikube | ||
cert-manager: | ||
enabled: true | ||
|
||
clusterDomain: harmony.test | ||
|
||
elasticsearch: | ||
enabled: true | ||
|
||
# TODO: move this to a separate PR | ||
# Permit co-located instances for solitary minikube virtual machines. | ||
antiAffinity: "soft" | ||
|
||
volumeClaimTemplate: | ||
resources: | ||
requests: | ||
storage: 8Gi | ||
|
||
opensearch: | ||
enabled: false | ||
|
||
# Permit co-located instances for solitary minikube virtual machines. | ||
antiAffinity: "soft" | ||
|
||
persistence: | ||
size: 8Gi | ||
|
||
prometheusstack: | ||
enabled: true | ||
|
||
k8sdashboard: | ||
enabled: false | ||
|
||
openfaas: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ingress nginx | ||
# cert manager | ||
# elastichsearch - openedx | ||
# opensearch - openedx | ||
# prometheusstack | ||
|
||
|
||
|
||
# steps | ||
# 1. Create a key for a CA | ||
openssl genrsa -des3 -out harmony.key 2048 | ||
# 2. Generate a root certificate | ||
openssl req -x509 -new -nodes -key harmony.key -sha256 -days 1825 -out harmony.pem | ||
# 3. Install Certificate | ||
sudo cp harmony.pem /usr/local/share/ca-certificates/harmony.crt | ||
sudo update-ca-certificates | ||
# 4. Creating CA-signed certificates for dev site | ||
openssl genrsa -out harmony.test.key 2048 | ||
# 4.1 Create CSR: | ||
openssl req -new -key harmony.test.key -out harmony.test.csr | ||
# 4.2 Sign certifcate | ||
openssl x509 -req -in harmony.test.csr -CA harmony.pem -CAkey harmony.key -CAcreateserial -out harmony.test.crt -days 825 -sha256 -extfile harmony.test.ext | ||
|
||
# Setup certificates | ||
sudo mkdir -p /etc/systemd/resolved.conf.d | ||
sudo tee /etc/systemd/resolved.conf.d/minikube.conf << EOF | ||
[Resolve] | ||
DNS=$(minikube ip) | ||
Domains=~harmony.test | ||
EOF | ||
sudo systemctl restart systemd-resolved | ||
|
||
# Enable certificate on minikube | ||
cp harmony.pem $HOME/.minikube/certs/harmony.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters