Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test adding a kind worker to test setup #83

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/test-kind-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
- role: worker
37 changes: 26 additions & 11 deletions .github/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,14 @@ kubectl logs ${fluence_pod} -c scheduler-plugins-scheduler
cd ${here}/examples/test_example

# Apply both example jobs
kubectl apply -f fluence-job.yaml
kubectl apply -f default-job.yaml

# Get them based on associated job
fluence_job_pod=$(kubectl get pods --selector=job-name=fluence-job -o json | jq -r .items[0].metadata.name)
default_job_pod=$(kubectl get pods --selector=job-name=default-job -o json | jq -r .items[0].metadata.name)

echo
echo "Fluence job pod is ${fluence_job_pod}"
echo "Default job pod is ${default_job_pod}"
sleep 10
sleep 20

# Shared function to check output
function check_output {
Expand All @@ -69,13 +66,38 @@ function check_output {
fi
}

# Pods should be completed
kubectl get pods
kubectl describe pods

# Get output (and show)
default_output=$(kubectl logs ${default_job_pod})
default_scheduled_by=$(kubectl get pod ${default_job_pod} -o json | jq -r .spec.schedulerName)
echo
echo "Default scheduler pod output: ${default_output}"
echo " Scheduled by: ${default_scheduled_by}"

check_output 'check-default-scheduled-by' "${default_scheduled_by}" "default-scheduler"
check_output 'check-default-output' "${default_output}" "not potato"

# And the second should be the default scheduler, but reportingComponent is empty and we see the
# result in the source -> component
reported_by=$(kubectl events --for pod/${default_job_pod} -o json | jq -c '[ .items[] | select( .reason | contains("Scheduled")) ]' | jq -r .[0].source.component)
check_output 'reported-by-default' "${reported_by}" "default-scheduler"

# Now delete default, schedule fluence
kubectl delete -f default-job.yaml
echo
kubectl apply -f fluence-job.yaml
sleep 10

# View logs again
echo
echo "⭐️ kubectl logs ${fluence_pod} -c sidecar"
kubectl logs ${fluence_pod} -c sidecar

fluence_job_pod=$(kubectl get pods --selector=job-name=fluence-job -o json | jq -r .items[0].metadata.name)
echo "Fluence job pod is ${fluence_job_pod}"
fluence_output=$(kubectl logs ${fluence_job_pod})
fluence_scheduled_by=$(kubectl get pod ${fluence_job_pod} -o json | jq -r .spec.schedulerName)
echo
Expand All @@ -84,16 +106,9 @@ echo " Scheduled by: ${fluence_scheduled_by}"

# Check output explicitly
check_output 'check-fluence-output' "${fluence_output}" "potato"
check_output 'check-default-output' "${default_output}" "not potato"
check_output 'check-default-scheduled-by' "${default_scheduled_by}" "default-scheduler"
check_output 'check-fluence-scheduled-by' "${fluence_scheduled_by}" "fluence"

# But events tell us actually what happened, let's parse throught them and find our pods
# This tells us the Event -> reason "Scheduled" and who it was reported by.
reported_by=$(kubectl events --for pod/${fluence_job_pod} -o json | jq -c '[ .items[] | select( .reason | contains("Scheduled")) ]' | jq -r .[0].reportingComponent)
check_output 'reported-by-fluence' "${reported_by}" "fluence"

# And the second should be the default scheduler, but reportingComponent is empty and we see the
# result in the source -> component
reported_by=$(kubectl events --for pod/${default_job_pod} -o json | jq -c '[ .items[] | select( .reason | contains("Scheduled")) ]' | jq -r .[0].source.component)
check_output 'reported-by-default' "${reported_by}" "default-scheduler"
8 changes: 4 additions & 4 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ jobs:
docker image ls -a | grep fluence

- name: Create Kind Cluster
uses: helm/kind-action@v1.5.0
uses: helm/kind-action@v1
with:
cluster_name: kind
kubectl_version: v1.28.2
version: v0.20.0
kubectl_version: v1.30.3
version: v0.23.0
config: ./.github/test-kind-config.yaml

- name: Load Docker Containers into Kind
Expand All @@ -145,7 +145,7 @@ jobs:

- name: Install Cert Manager
run: |
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.1/cert-manager.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.15.3/cert-manager.yaml
sleep 10

- name: Test Fluence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ spec:
httpGet:
path: /healthz
port: 10259
scheme: HTTPS
scheme: {{ .Values.scheduler.httpScheme }}
initialDelaySeconds: 15
name: scheduler-plugins-scheduler
readinessProbe:
httpGet:
path: /healthz
port: 10259
scheme: HTTPS
scheme: {{ .Values.scheduler.httpScheme }}
resources:
requests:
cpu: '0.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ scheduler:
pullPolicy: Always
sidecarPullPolicy: Always
loggingLevel: "9"
httpScheme: HTTPS

# Port is for GRPC, and enabling the external service will also
# create the service and ingress to it, along with adding
Expand Down
1 change: 1 addition & 0 deletions src/fluence/fluxion/fluxion.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func (fluxion *Fluxion) InitFluxion(policy string, label string) {
klog.Error("Error reading JGF")
return
}
klog.Infof("[Fluence] JGF: %s", string(jgf))

p := "{}"
if policy != "" {
Expand Down
Loading