diff --git a/.github/workflows/gh-akf-new-release.yaml b/.github/workflows/gh-akf-new-release.yaml index d615c02..74ddf7d 100644 --- a/.github/workflows/gh-akf-new-release.yaml +++ b/.github/workflows/gh-akf-new-release.yaml @@ -129,13 +129,13 @@ jobs: Download the appropriate binary for your platform, make it executable, and add it to your PATH. ### Download Client - For more information, visit [AkôFlow Client documentation](https://akoflow.com/docs/). + For more information, visit [AkôFlow Client documentation](https://github.com/UFFeScience/akoflow/wiki/). ### Download Server - For more information, visit [AkôFlow Server documentation](https://akoflow.com/docs/). + For more information, visit [AkôFlow Server documentation](https://github.com/UFFeScience/akoflow/wiki/). ## Documentation - For more information, visit [AkôFlow documentation](https://akoflow.com/docs/). + For more information, visit [AkôFlow documentation](https://github.com/UFFeScience/akoflow/wiki/). draft: false prerelease: false files: | diff --git a/.gitignore b/.gitignore index 49bce2b..9e12242 100755 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ releases/bin/* *.db *.sif .env -resources/ \ No newline at end of file +resources/ +keys/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 1544457..542760e 100755 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -7,10 +7,7 @@ "request": "launch", "mode": "debug", "program": "cmd/server/main.go", - "env": { - "K8S_API_SERVER_HOST": "localhost", - "K8S_API_SERVER_TOKEN": "dummy", - } + "buildFlags": ["-gcflags=all=-N -l"] }, { "name": "Launch AkoFlow Client Run", diff --git a/README.md b/README.md index 35389bf..7f81f5b 100755 --- a/README.md +++ b/README.md @@ -21,10 +21,17 @@ Although initially focused on Kubernetes-based workloads, AkôFlow has evolved t ⸻ -## Maintainers -* [D.Sc. Daniel de Oliveira — Research Advisor](http://profs.ic.uff.br/~danielcmo/) -* [Wesley Ferreira - @ovvesley — Maintainer](https://github.com/ovvesley) -* Raphael Garcia — Maintainer +## Contributors +* [D.Sc. Daniel de Oliveira — Research Advisor](http://profs.ic.uff.br/~danielcmo/) +* [Wesley Ferreira - @ovvesley — Maintainer - IC/UFF](https://github.com/ovvesley) +* Liliane Kunstmann - COPPE/UFRJ +* Debora Pina - COPPE/UFRJ +* Raphael Garcia — IC/UFF +* [Yuri Frota — IC/UFF](http://www.ic.uff.br/~yuri/) +* [Marcos Bedo — IC/UFF](https://www.professores.uff.br/marcosbedo/) +* [Aline Paes — IC/UFF](http://www.ic.uff.br/~alinepaes/) +* [Luan Teylo — INRIA/Université de Bordeaux](https://team.inria.fr/) + ⸻ diff --git a/pkg/client/resource/multiple-runtimes/wf-01.yaml b/pkg/client/resource/multiple-runtimes/wf-01.yaml index ccdc9f3..055eb7d 100644 --- a/pkg/client/resource/multiple-runtimes/wf-01.yaml +++ b/pkg/client/resource/multiple-runtimes/wf-01.yaml @@ -1,6 +1,8 @@ name: wf-hello-world-gcp spec: namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" storagePolicy: storageClassName: "standard" storageSize: "32Mi" @@ -8,96 +10,108 @@ spec: mountPath: "/data" activities: - name: "a" - memoryLimit: 500Mi + memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s1" image: "alpine:3.18" run: | - echo "Hello World" >> /data/a/output.txt + echo "Hello World" >> output.txt sleep 5 - echo "Hello World Again" >> /data/a/output.txt + echo "Hello World Again" >> output.txt sleep 5 - echo "Hello World One More Time" >> /data/a/output.txt + echo "Hello World One More Time" >> output.txt - name: "b" memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s2" + runtime: "k8s" image: "alpine:3.18" run: | - echo "Good Afternoon" >> /data/b/output.txt + echo "Good Afternoon" >> output.txt sleep 5 - echo "Good Afternoon Again" >> /data/b/output.txt + echo "Good Afternoon Again" >> output.txt sleep 5 - echo "Good Afternoon One More Time" >> /data/b/output.txt + echo "Good Afternoon One More Time" >> output.txt - name: "c" memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s1" + runtime: "k8s" image: "alpine:3.18" run: | - echo "Goodbye" >> /data/c/output.txt + echo "Goodbye" >> output.txt sleep 5 - echo "Goodbye Again" >> /data/c/output.txt + echo "Goodbye Again" >> output.txt sleep 5 - echo "Goodbye One More Time" >> /data/c/output.txt + echo "Goodbye One More Time" >> output.txt - name: "d" memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s1" + runtime: "k8s" image: "alpine:3.18" run: | - echo "Goodbye" >> /data/d/output.txt + echo "Goodbye" >> output.txt + sleep 5 + echo "Goodbye Again" >> output.txt sleep 5 - echo "Goodbye Again" >> /data/d/output.txt + echo "Goodbye One More Time" >> output.txt + + - name: "e" + memoryLimit: 500Mi + cpuLimit: 0.5 + runtime: "k8s" + image: "alpine:3.18" + run: | + echo "Goodbye" >> output.txt sleep 5 - echo "Goodbye One More Time" >> /data/d/output.txt + echo "Goodbye Again" >> output.txt + sleep 5 + echo "Goodbye One More Time" >> output.txt dependsOn: - "a" - "b" - "c" + - "d" - - name: "e" + - name: "f" memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s2" + runtime: "k8s" image: "alpine:3.18" run: | - echo "Goodbye" >> /data/e/output.txt + echo "Goodbye" >> output.txt sleep 5 - echo "Goodbye Again" >> /data/e/output.txt + echo "Goodbye Again" >> output.txt sleep 5 - echo "Goodbye One More Time" >> /data/e/output.txt + echo "Goodbye One More Time" >> output.txt dependsOn: - "c" - - name: "f" + - name: "g" memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s2" + runtime: "k8s" image: "alpine:3.18" run: | - echo "Goodbye" >> /data/f/output.txt + echo "Goodbye" >> output.txt sleep 5 - echo "Goodbye Again" >> /data/f/output.txt + echo "Goodbye Again" >> output.txt sleep 5 - echo "Goodbye One More Time" >> /data/f/output.txt + echo "Goodbye One More Time" >> output.txt dependsOn: - "d" - "e" - - name: "g" + - name: "h" memoryLimit: 500Mi cpuLimit: 0.5 - runtime: "k8s1" + runtime: "k8s" image: "alpine:3.18" run: | - echo "Goodbye" >> /data/g/output.txt + echo "Goodbye" >> output.txt sleep 5 - echo "Goodbye Again" >> /data/g/output.txt + echo "Goodbye Again" >> output.txt sleep 5 - echo "Goodbye One More Time" >> /data/g/output.txt + echo "Goodbye One More Time" >> output.txt sleep 300 dependsOn: diff --git a/pkg/client/resource/schedules/wf-01-a00.yaml b/pkg/client/resource/schedules/wf-01-a00.yaml new file mode 100644 index 0000000..2f80e0a --- /dev/null +++ b/pkg/client/resource/schedules/wf-01-a00.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-a +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 1543Mi # 1343 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # 840 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # 1045 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + - name: "activity4" + memoryLimit: 1202Mi # 1002 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # 1423 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 1574Mi # 1374 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18975 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 1750Mi # 1550 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 20158 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1090Mi # 890 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 15278 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 1365Mi # 1165 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 17474 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 1044Mi # 844 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14871 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-01-a05.yaml b/pkg/client/resource/schedules/wf-01-a05.yaml new file mode 100644 index 0000000..3a744ff --- /dev/null +++ b/pkg/client/resource/schedules/wf-01-a05.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-a +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 1543Mi # 1343 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # 840 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # 1045 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + - name: "activity4" + memoryLimit: 1202Mi # 1002 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # 1423 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 1574Mi # 1374 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18975 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 1750Mi # 1550 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 20158 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1090Mi # 890 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 15278 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 1365Mi # 1165 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 17474 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 1044Mi # 844 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14871 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-01-a10.yaml b/pkg/client/resource/schedules/wf-01-a10.yaml new file mode 100644 index 0000000..c716885 --- /dev/null +++ b/pkg/client/resource/schedules/wf-01-a10.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-a +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 1543Mi # 1343 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # 840 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # 1045 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + - name: "activity4" + memoryLimit: 1202Mi # 1002 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # 1423 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 1574Mi # 1374 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18975 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 1750Mi # 1550 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 20158 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1090Mi # 890 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 15278 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 1365Mi # 1165 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 17474 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 1044Mi # 844 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14871 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-02-a00.yaml b/pkg/client/resource/schedules/wf-02-a00.yaml new file mode 100644 index 0000000..4381bf8 --- /dev/null +++ b/pkg/client/resource/schedules/wf-02-a00.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-b +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 6163Mi # 5963 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39536 + + - name: "activity2" + memoryLimit: 5156Mi # 4956 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36045 + + - name: "activity3" + memoryLimit: 5566Mi #5366 + 200 + cpuLimit: 0.8 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37505 + + - name: "activity4" + memoryLimit: 5481Mi # 5281 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 6322Mi # 6122 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40060 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 6224Mi # 6024 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 6577Mi # 6377 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # 5058 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 5807Mi # 5607 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 5164Mi # 4964 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-02-a05.yaml b/pkg/client/resource/schedules/wf-02-a05.yaml new file mode 100644 index 0000000..873e7e8 --- /dev/null +++ b/pkg/client/resource/schedules/wf-02-a05.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-b +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 6163Mi # 5963 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39536 + + - name: "activity2" + memoryLimit: 5156Mi # 4956 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36045 + + - name: "activity3" + memoryLimit: 5566Mi # 5366 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37505 + + - name: "activity4" + memoryLimit: 5481Mi # 5281 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 6322Mi # 6122 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40060 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 6224Mi # 6024 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 6577Mi # 6377 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # 5058 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 5807Mi # 5607 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 5164Mi # 4964 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-02-a10.yaml b/pkg/client/resource/schedules/wf-02-a10.yaml new file mode 100644 index 0000000..e000bd7 --- /dev/null +++ b/pkg/client/resource/schedules/wf-02-a10.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-b +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 6163Mi # 5963 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39536 + + - name: "activity2" + memoryLimit: 5156Mi # 4956 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36045 + + - name: "activity3" + memoryLimit: 5566Mi # 5366 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37505 + + - name: "activity4" + memoryLimit: 5481Mi # 5281 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 6322Mi # 6122 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40060 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 6224Mi # 6024 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 6577Mi # 6377 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # 5058 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 5807Mi # 5607 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 5164Mi # 4964 + 200 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-03a-a00.yaml b/pkg/client/resource/schedules/wf-03a-a00.yaml new file mode 100644 index 0000000..fae9143 --- /dev/null +++ b/pkg/client/resource/schedules/wf-03a-a00.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-c +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 1543Mi # matrix≈1342.96 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # matrix≈839.64 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # matrix≈1044.48 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + - name: "activity4" + memoryLimit: 1202Mi # matrix≈1001.99 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # matrix≈1422.56 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 6224Mi # matrix≈6023.82 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 6577Mi # matrix≈6376.90 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # matrix≈5057.65 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 5807Mi # matrix≈5606.56 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 5164Mi # matrix≈4963.92 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-03a-a05.yaml b/pkg/client/resource/schedules/wf-03a-a05.yaml new file mode 100644 index 0000000..e7e0d78 --- /dev/null +++ b/pkg/client/resource/schedules/wf-03a-a05.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-c +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 1543Mi # matrix≈1342.96 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # matrix≈839.64 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # matrix≈1044.48 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + - name: "activity4" + memoryLimit: 1202Mi # matrix≈1001.99 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # matrix≈1422.56 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 6224Mi # matrix≈6023.82 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 6577Mi # matrix≈6376.90 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # matrix≈5057.65 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 5807Mi # matrix≈5606.56 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 5164Mi # matrix≈4963.92 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-03a-a10.yaml b/pkg/client/resource/schedules/wf-03a-a10.yaml new file mode 100644 index 0000000..b4f0288 --- /dev/null +++ b/pkg/client/resource/schedules/wf-03a-a10.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-c +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 1543Mi # matrix≈1342.96 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # matrix≈839.64 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # matrix≈1044.48 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + - name: "activity4" + memoryLimit: 1202Mi # matrix≈1001.99 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # matrix≈1422.56 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 6224Mi # matrix≈6023.82 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 6577Mi # matrix≈6376.90 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # matrix≈5057.65 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 5807Mi # matrix≈5606.56 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 5164Mi # matrix≈4963.92 MB + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-03b-a00.yaml b/pkg/client/resource/schedules/wf-03b-a00.yaml new file mode 100644 index 0000000..6d9ca84 --- /dev/null +++ b/pkg/client/resource/schedules/wf-03b-a00.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-c +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 6224Mi # invertido com activity6 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + + - name: "activity2" + memoryLimit: 6577Mi # invertido com activity7 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + + - name: "activity3" + memoryLimit: 5258Mi # invertido com activity8 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + + - name: "activity4" + memoryLimit: 5807Mi # invertido com activity9 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 5164Mi # invertido com activity10 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 1543Mi # invertido com activity1 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 1040Mi # invertido com activity2 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1245Mi # invertido com activity3 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 1202Mi # invertido com activity4 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 1623Mi # invertido com activity5 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-03b-a05.yaml b/pkg/client/resource/schedules/wf-03b-a05.yaml new file mode 100644 index 0000000..1e42d49 --- /dev/null +++ b/pkg/client/resource/schedules/wf-03b-a05.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-c +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 6224Mi # invertido com activity6 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + + - name: "activity2" + memoryLimit: 6577Mi # invertido com activity7 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + + - name: "activity3" + memoryLimit: 5258Mi # invertido com activity8 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + + - name: "activity4" + memoryLimit: 5807Mi # invertido com activity9 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 5164Mi # invertido com activity10 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 1543Mi # invertido com activity1 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 1040Mi # invertido com activity2 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1245Mi # invertido com activity3 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 1202Mi # invertido com activity4 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 1623Mi # invertido com activity5 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-03b-a10.yaml b/pkg/client/resource/schedules/wf-03b-a10.yaml new file mode 100644 index 0000000..d973878 --- /dev/null +++ b/pkg/client/resource/schedules/wf-03b-a10.yaml @@ -0,0 +1,98 @@ +name: wf-schedule-c +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + - name: "activity1" + memoryLimit: 6224Mi # invertido com activity6 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + + - name: "activity2" + memoryLimit: 6577Mi # invertido com activity7 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + + - name: "activity3" + memoryLimit: 5258Mi # invertido com activity8 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + + - name: "activity4" + memoryLimit: 5807Mi # invertido com activity9 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 5164Mi # invertido com activity10 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity2" + - "activity3" + + - name: "activity6" + memoryLimit: 1543Mi # invertido com activity1 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + dependsOn: + - "activity4" + - "activity5" + + - name: "activity7" + memoryLimit: 1040Mi # invertido com activity2 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1245Mi # invertido com activity3 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + dependsOn: + - "activity6" + + - name: "activity9" + memoryLimit: 1202Mi # invertido com activity4 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity7" + - "activity8" + + - name: "activity10" + memoryLimit: 1623Mi # invertido com activity5 + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-04-a00.yaml b/pkg/client/resource/schedules/wf-04-a00.yaml new file mode 100644 index 0000000..f42a58c --- /dev/null +++ b/pkg/client/resource/schedules/wf-04-a00.yaml @@ -0,0 +1,104 @@ +name: wf-schedule-d +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + # Nível 1 (L -> Class A) + - name: "activity1" + memoryLimit: 1543Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + # Nível 2 (L -> Class A) + - name: "activity4" + memoryLimit: 1202Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + # Nível 3 (H -> Class B) + - name: "activity6" + memoryLimit: 6224Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + # Nível 4 (L -> Class A) + - name: "activity7" + memoryLimit: 1750Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 20158 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1090Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 15278 + dependsOn: + - "activity6" + + # Nível 5 (H -> Class B) + - name: "activity9" + memoryLimit: 5807Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + # Nível 6 (H -> Class B) + - name: "activity10" + memoryLimit: 5164Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-04-a05.yaml b/pkg/client/resource/schedules/wf-04-a05.yaml new file mode 100644 index 0000000..632c64f --- /dev/null +++ b/pkg/client/resource/schedules/wf-04-a05.yaml @@ -0,0 +1,104 @@ +name: wf-schedule-d +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + # Nível 1 (L -> Class A) + - name: "activity1" + memoryLimit: 1543Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + # Nível 2 (L -> Class A) + - name: "activity4" + memoryLimit: 1202Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + # Nível 3 (H -> Class B) + - name: "activity6" + memoryLimit: 6224Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + # Nível 4 (L -> Class A) + - name: "activity7" + memoryLimit: 1750Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 20158 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1090Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 15278 + dependsOn: + - "activity6" + + # Nível 5 (H -> Class B) + - name: "activity9" + memoryLimit: 5807Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + # Nível 6 (H -> Class B) + - name: "activity10" + memoryLimit: 5164Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-04-a10.yaml b/pkg/client/resource/schedules/wf-04-a10.yaml new file mode 100644 index 0000000..a53b4fb --- /dev/null +++ b/pkg/client/resource/schedules/wf-04-a10.yaml @@ -0,0 +1,104 @@ +name: wf-schedule-LLHLHHLLHA +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + # Nível 1 (L -> Class A) + - name: "activity1" + memoryLimit: 1543Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18763 + + - name: "activity2" + memoryLimit: 1040Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14836 + + - name: "activity3" + memoryLimit: 1245Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16547 + + # Nível 2 (L -> Class A) + - name: "activity4" + memoryLimit: 1202Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 16207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 1623Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 19311 + dependsOn: + - "activity2" + - "activity3" + + # Nível 3 (H -> Class B) + - name: "activity6" + memoryLimit: 6224Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39738 + dependsOn: + - "activity4" + - "activity5" + + # Nível 4 (L -> Class A) + - name: "activity7" + memoryLimit: 1750Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 20158 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 1090Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 15278 + dependsOn: + - "activity6" + + # Nível 5 (H -> Class B) + - name: "activity9" + memoryLimit: 5807Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 38337 + dependsOn: + - "activity7" + - "activity8" + + # Nível 6 (H -> Class B) + - name: "activity10" + memoryLimit: 5164Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36073 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-05-a00.yaml b/pkg/client/resource/schedules/wf-05-a00.yaml new file mode 100644 index 0000000..ff09833 --- /dev/null +++ b/pkg/client/resource/schedules/wf-05-a00.yaml @@ -0,0 +1,104 @@ +name: wf-schedule-e +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + # Nível 1 (H -> Class B) + - name: "activity1" + memoryLimit: 6163Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39536 + + - name: "activity2" + memoryLimit: 5156Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36045 + + - name: "activity3" + memoryLimit: 5566Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37505 + + # Nível 2 (H -> Class B) + - name: "activity4" + memoryLimit: 5481Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 6322Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40060 + dependsOn: + - "activity2" + - "activity3" + + # Nível 3 (L -> Class A) + - name: "activity6" + memoryLimit: 1574Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18975 + dependsOn: + - "activity4" + - "activity5" + + # Nível 4 (H -> Class B) + - name: "activity7" + memoryLimit: 6577Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + # Nível 5 (L -> Class A) + - name: "activity9" + memoryLimit: 1365Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 17474 + dependsOn: + - "activity7" + - "activity8" + + # Nível 6 (L -> Class A) + - name: "activity10" + memoryLimit: 1044Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14871 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-05-a05.yaml b/pkg/client/resource/schedules/wf-05-a05.yaml new file mode 100644 index 0000000..788719a --- /dev/null +++ b/pkg/client/resource/schedules/wf-05-a05.yaml @@ -0,0 +1,104 @@ +name: wf-schedule-e +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + # Nível 1 (H -> Class B) + - name: "activity1" + memoryLimit: 6163Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39536 + + - name: "activity2" + memoryLimit: 5156Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36045 + + - name: "activity3" + memoryLimit: 5566Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37505 + + # Nível 2 (H -> Class B) + - name: "activity4" + memoryLimit: 5481Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 6322Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40060 + dependsOn: + - "activity2" + - "activity3" + + # Nível 3 (L -> Class A) + - name: "activity6" + memoryLimit: 1574Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18975 + dependsOn: + - "activity4" + - "activity5" + + # Nível 4 (H -> Class B) + - name: "activity7" + memoryLimit: 6577Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + # Nível 5 (L -> Class A) + - name: "activity9" + memoryLimit: 1365Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 17474 + dependsOn: + - "activity7" + - "activity8" + + # Nível 6 (L -> Class A) + - name: "activity10" + memoryLimit: 1044Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14871 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-05-a10.yaml b/pkg/client/resource/schedules/wf-05-a10.yaml new file mode 100644 index 0000000..a84ec63 --- /dev/null +++ b/pkg/client/resource/schedules/wf-05-a10.yaml @@ -0,0 +1,104 @@ +name: wf-schedule-e +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" + storagePolicy: + storageClassName: "local-path" + storageSize: "32Mi" + type: distributed + mountPath: "/export" + activities: + # Nível 1 (H -> Class B) + - name: "activity1" + memoryLimit: 6163Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 39536 + + - name: "activity2" + memoryLimit: 5156Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36045 + + - name: "activity3" + memoryLimit: 5566Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37505 + + # Nível 2 (H -> Class B) + - name: "activity4" + memoryLimit: 5481Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 37207 + dependsOn: + - "activity1" + - "activity2" + + - name: "activity5" + memoryLimit: 6322Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40060 + dependsOn: + - "activity2" + - "activity3" + + # Nível 3 (L -> Class A) + - name: "activity6" + memoryLimit: 1574Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 18975 + dependsOn: + - "activity4" + - "activity5" + + # Nível 4 (H -> Class B) + - name: "activity7" + memoryLimit: 6577Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 40886 + dependsOn: + - "activity6" + + - name: "activity8" + memoryLimit: 5258Mi # Class B + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 36412 + dependsOn: + - "activity6" + + # Nível 5 (L -> Class A) + - name: "activity9" + memoryLimit: 1365Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 17474 + dependsOn: + - "activity7" + - "activity8" + + # Nível 6 (L -> Class A) + - name: "activity10" + memoryLimit: 1044Mi # Class A + cpuLimit: 1.0 + image: "ovvesley/synthetic:alpha1x86" + run: | + /home/app/bin/synthetic 14871 + dependsOn: + - "activity9" \ No newline at end of file diff --git a/pkg/client/resource/schedules/wf-montage-a00.yaml b/pkg/client/resource/schedules/wf-montage-a00.yaml new file mode 100644 index 0000000..2054839 --- /dev/null +++ b/pkg/client/resource/schedules/wf-montage-a00.yaml @@ -0,0 +1,461 @@ +name: wf-schedule-montage +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule3" + storagePolicy: + storageClassName: "local-path" + storageSize: "256Mi" + type: distributed + mountPath: "/data" + image: ovvesley/akoflow-wf-montage:050d + activities: + - name: mprojectid0000001 + run: mProject -X poss2ukstu_blue_001_001.fits pposs2ukstu_blue_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000002 + run: mProject -X poss2ukstu_blue_001_002.fits pposs2ukstu_blue_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000003 + run: mProject -X poss2ukstu_blue_002_001.fits pposs2ukstu_blue_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000004 + run: mProject -X poss2ukstu_blue_002_002.fits pposs2ukstu_blue_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000005 + run: mDiffFit -d -s 1-fit.000001.000002.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_001_002.fits 1-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000002 + + - name: mdifffitid0000006 + run: mDiffFit -d -s 1-fit.000001.000003.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_002_001.fits 1-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000003 + + - name: mdifffitid0000007 + run: mDiffFit -d -s 1-fit.000001.000004.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_002_002.fits 1-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000004 + + - name: mdifffitid0000008 + run: mDiffFit -d -s 1-fit.000002.000003.txt pposs2ukstu_blue_001_002.fits pposs2ukstu_blue_002_001.fits 1-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mprojectid0000003 + + - name: mdifffitid0000009 + run: mDiffFit -d -s 1-fit.000002.000004.txt pposs2ukstu_blue_001_002.fits pposs2ukstu_blue_002_002.fits 1-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mprojectid0000004 + + - name: mdifffitid0000010 + run: mDiffFit -d -s 1-fit.000003.000004.txt pposs2ukstu_blue_002_001.fits pposs2ukstu_blue_002_002.fits 1-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000003 + - mprojectid0000004 + + - name: mconcatfitid0000011 + run: mConcatFit 1-stat.tbl 1-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000005 + - mdifffitid0000006 + - mdifffitid0000007 + - mdifffitid0000008 + - mdifffitid0000009 + - mdifffitid0000010 + + - name: mbgmodelid0000012 + run: mBgModel -i 100000 1-images.tbl 1-fits.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000011 + + - name: mbackgroundid0000013 + run: mBackground -t pposs2ukstu_blue_001_001.fits cposs2ukstu_blue_001_001.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mbgmodelid0000012 + + - name: mbackgroundid0000014 + run: mBackground -t pposs2ukstu_blue_001_002.fits cposs2ukstu_blue_001_002.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mbgmodelid0000012 + + - name: mbackgroundid0000015 + run: mBackground -t pposs2ukstu_blue_002_001.fits cposs2ukstu_blue_002_001.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000003 + - mbgmodelid0000012 + + - name: mbackgroundid0000016 + run: mBackground -t pposs2ukstu_blue_002_002.fits cposs2ukstu_blue_002_002.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000004 + - mbgmodelid0000012 + + - name: mimgtblid0000017 + run: mImgtbl . -t 1-corrected.tbl 1-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000013 + - mbackgroundid0000014 + - mbackgroundid0000015 + - mbackgroundid0000016 + + - name: maddid0000018 + run: mAdd -e 1-updated-corrected.tbl region.hdr 1-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000013 + - mbackgroundid0000014 + - mbackgroundid0000015 + - mbackgroundid0000016 + - mimgtblid0000017 + + - name: mviewerid0000019 + run: mViewer -ct 1 -gray 1-mosaic.fits -1s max gaussian -png 1-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000018 + + - name: mprojectid0000020 + run: mProject -X poss2ukstu_red_001_001.fits pposs2ukstu_red_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000021 + run: mProject -X poss2ukstu_red_001_002.fits pposs2ukstu_red_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000022 + run: mProject -X poss2ukstu_red_002_001.fits pposs2ukstu_red_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000023 + run: mProject -X poss2ukstu_red_002_002.fits pposs2ukstu_red_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000024 + run: mDiffFit -d -s 2-fit.000001.000002.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_001_002.fits 2-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000021 + + - name: mdifffitid0000025 + run: mDiffFit -d -s 2-fit.000001.000003.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_002_001.fits 2-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000022 + + - name: mdifffitid0000026 + run: mDiffFit -d -s 2-fit.000001.000004.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_002_002.fits 2-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000023 + + - name: mdifffitid0000027 + run: mDiffFit -d -s 2-fit.000002.000003.txt pposs2ukstu_red_001_002.fits pposs2ukstu_red_002_001.fits 2-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mprojectid0000022 + + - name: mdifffitid0000028 + run: mDiffFit -d -s 2-fit.000002.000004.txt pposs2ukstu_red_001_002.fits pposs2ukstu_red_002_002.fits 2-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mprojectid0000023 + + - name: mdifffitid0000029 + run: mDiffFit -d -s 2-fit.000003.000004.txt pposs2ukstu_red_002_001.fits pposs2ukstu_red_002_002.fits 2-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000022 + - mprojectid0000023 + + - name: mconcatfitid0000030 + run: mConcatFit 2-stat.tbl 2-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000024 + - mdifffitid0000025 + - mdifffitid0000026 + - mdifffitid0000027 + - mdifffitid0000028 + - mdifffitid0000029 + + - name: mbgmodelid0000031 + run: mBgModel -i 100000 2-images.tbl 2-fits.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000030 + + - name: mbackgroundid0000032 + run: mBackground -t pposs2ukstu_red_001_001.fits cposs2ukstu_red_001_001.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mbgmodelid0000031 + + - name: mbackgroundid0000033 + run: mBackground -t pposs2ukstu_red_001_002.fits cposs2ukstu_red_001_002.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mbgmodelid0000031 + + - name: mbackgroundid0000034 + run: mBackground -t pposs2ukstu_red_002_001.fits cposs2ukstu_red_002_001.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000022 + - mbgmodelid0000031 + + - name: mbackgroundid0000035 + run: mBackground -t pposs2ukstu_red_002_002.fits cposs2ukstu_red_002_002.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000023 + - mbgmodelid0000031 + + - name: mimgtblid0000036 + run: mImgtbl . -t 2-corrected.tbl 2-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000032 + - mbackgroundid0000033 + - mbackgroundid0000034 + - mbackgroundid0000035 + + - name: maddid0000037 + run: mAdd -e 2-updated-corrected.tbl region.hdr 2-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000032 + - mbackgroundid0000033 + - mbackgroundid0000034 + - mbackgroundid0000035 + - mimgtblid0000036 + + - name: mviewerid0000038 + run: mViewer -ct 1 -gray 2-mosaic.fits -1s max gaussian -png 2-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000037 + + - name: mprojectid0000039 + run: mProject -X poss2ukstu_ir_001_001.fits pposs2ukstu_ir_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000040 + run: mProject -X poss2ukstu_ir_001_002.fits pposs2ukstu_ir_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000041 + run: mProject -X poss2ukstu_ir_002_001.fits pposs2ukstu_ir_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000042 + run: mProject -X poss2ukstu_ir_002_002.fits pposs2ukstu_ir_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000043 + run: mDiffFit -d -s 3-fit.000001.000002.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_001_002.fits 3-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000040 + + - name: mdifffitid0000044 + run: mDiffFit -d -s 3-fit.000001.000003.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_002_001.fits 3-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000041 + + - name: mdifffitid0000045 + run: mDiffFit -d -s 3-fit.000001.000004.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_002_002.fits 3-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000042 + + - name: mdifffitid0000046 + run: mDiffFit -d -s 3-fit.000002.000003.txt pposs2ukstu_ir_001_002.fits pposs2ukstu_ir_002_001.fits 3-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mprojectid0000041 + + - name: mdifffitid0000047 + run: mDiffFit -d -s 3-fit.000002.000004.txt pposs2ukstu_ir_001_002.fits pposs2ukstu_ir_002_002.fits 3-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mprojectid0000042 + + - name: mdifffitid0000048 + run: mDiffFit -d -s 3-fit.000003.000004.txt pposs2ukstu_ir_002_001.fits pposs2ukstu_ir_002_002.fits 3-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000041 + - mprojectid0000042 + + - name: mconcatfitid0000049 + run: mConcatFit 3-stat.tbl 3-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000043 + - mdifffitid0000044 + - mdifffitid0000045 + - mdifffitid0000046 + - mdifffitid0000047 + - mdifffitid0000048 + + - name: mbgmodelid0000050 + run: mBgModel -i 100000 3-images.tbl 3-fits.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000049 + + - name: mbackgroundid0000051 + run: mBackground -t pposs2ukstu_ir_001_001.fits cposs2ukstu_ir_001_001.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mbgmodelid0000050 + + - name: mbackgroundid0000052 + run: mBackground -t pposs2ukstu_ir_001_002.fits cposs2ukstu_ir_001_002.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mbgmodelid0000050 + + - name: mbackgroundid0000053 + run: mBackground -t pposs2ukstu_ir_002_001.fits cposs2ukstu_ir_002_001.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000041 + - mbgmodelid0000050 + + - name: mbackgroundid0000054 + run: mBackground -t pposs2ukstu_ir_002_002.fits cposs2ukstu_ir_002_002.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000042 + - mbgmodelid0000050 + + - name: mimgtblid0000055 + run: mImgtbl . -t 3-corrected.tbl 3-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000051 + - mbackgroundid0000052 + - mbackgroundid0000053 + - mbackgroundid0000054 + + - name: maddid0000056 + run: mAdd -e 3-updated-corrected.tbl region.hdr 3-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000051 + - mbackgroundid0000052 + - mbackgroundid0000053 + - mbackgroundid0000054 + - mimgtblid0000055 + + - name: mviewerid0000057 + run: mViewer -ct 1 -gray 3-mosaic.fits -1s max gaussian -png 3-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000056 + + - name: mviewerid0000058 + run: mViewer -red 3-mosaic.fits -0.5s max gaussian-log -green 2-mosaic.fits -0.5s max gaussian-log -blue 1-mosaic.fits -0.5s max gaussian-log -png mosaic-color.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000018 + - maddid0000037 + - maddid0000056 diff --git a/pkg/client/resource/schedules/wf-montage-a05.yaml b/pkg/client/resource/schedules/wf-montage-a05.yaml new file mode 100644 index 0000000..aa07fd5 --- /dev/null +++ b/pkg/client/resource/schedules/wf-montage-a05.yaml @@ -0,0 +1,461 @@ +name: wf-schedule-montage +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule2" + storagePolicy: + storageClassName: "local-path" + storageSize: "256Mi" + type: distributed + mountPath: "/data" + image: ovvesley/akoflow-wf-montage:050d + activities: + - name: mprojectid0000001 + run: mProject -X poss2ukstu_blue_001_001.fits pposs2ukstu_blue_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000002 + run: mProject -X poss2ukstu_blue_001_002.fits pposs2ukstu_blue_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000003 + run: mProject -X poss2ukstu_blue_002_001.fits pposs2ukstu_blue_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000004 + run: mProject -X poss2ukstu_blue_002_002.fits pposs2ukstu_blue_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000005 + run: mDiffFit -d -s 1-fit.000001.000002.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_001_002.fits 1-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000002 + + - name: mdifffitid0000006 + run: mDiffFit -d -s 1-fit.000001.000003.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_002_001.fits 1-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000003 + + - name: mdifffitid0000007 + run: mDiffFit -d -s 1-fit.000001.000004.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_002_002.fits 1-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000004 + + - name: mdifffitid0000008 + run: mDiffFit -d -s 1-fit.000002.000003.txt pposs2ukstu_blue_001_002.fits pposs2ukstu_blue_002_001.fits 1-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mprojectid0000003 + + - name: mdifffitid0000009 + run: mDiffFit -d -s 1-fit.000002.000004.txt pposs2ukstu_blue_001_002.fits pposs2ukstu_blue_002_002.fits 1-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mprojectid0000004 + + - name: mdifffitid0000010 + run: mDiffFit -d -s 1-fit.000003.000004.txt pposs2ukstu_blue_002_001.fits pposs2ukstu_blue_002_002.fits 1-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000003 + - mprojectid0000004 + + - name: mconcatfitid0000011 + run: mConcatFit 1-stat.tbl 1-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000005 + - mdifffitid0000006 + - mdifffitid0000007 + - mdifffitid0000008 + - mdifffitid0000009 + - mdifffitid0000010 + + - name: mbgmodelid0000012 + run: mBgModel -i 100000 1-images.tbl 1-fits.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000011 + + - name: mbackgroundid0000013 + run: mBackground -t pposs2ukstu_blue_001_001.fits cposs2ukstu_blue_001_001.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mbgmodelid0000012 + + - name: mbackgroundid0000014 + run: mBackground -t pposs2ukstu_blue_001_002.fits cposs2ukstu_blue_001_002.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mbgmodelid0000012 + + - name: mbackgroundid0000015 + run: mBackground -t pposs2ukstu_blue_002_001.fits cposs2ukstu_blue_002_001.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000003 + - mbgmodelid0000012 + + - name: mbackgroundid0000016 + run: mBackground -t pposs2ukstu_blue_002_002.fits cposs2ukstu_blue_002_002.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000004 + - mbgmodelid0000012 + + - name: mimgtblid0000017 + run: mImgtbl . -t 1-corrected.tbl 1-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000013 + - mbackgroundid0000014 + - mbackgroundid0000015 + - mbackgroundid0000016 + + - name: maddid0000018 + run: mAdd -e 1-updated-corrected.tbl region.hdr 1-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000013 + - mbackgroundid0000014 + - mbackgroundid0000015 + - mbackgroundid0000016 + - mimgtblid0000017 + + - name: mviewerid0000019 + run: mViewer -ct 1 -gray 1-mosaic.fits -1s max gaussian -png 1-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000018 + + - name: mprojectid0000020 + run: mProject -X poss2ukstu_red_001_001.fits pposs2ukstu_red_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000021 + run: mProject -X poss2ukstu_red_001_002.fits pposs2ukstu_red_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000022 + run: mProject -X poss2ukstu_red_002_001.fits pposs2ukstu_red_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000023 + run: mProject -X poss2ukstu_red_002_002.fits pposs2ukstu_red_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000024 + run: mDiffFit -d -s 2-fit.000001.000002.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_001_002.fits 2-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000021 + + - name: mdifffitid0000025 + run: mDiffFit -d -s 2-fit.000001.000003.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_002_001.fits 2-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000022 + + - name: mdifffitid0000026 + run: mDiffFit -d -s 2-fit.000001.000004.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_002_002.fits 2-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000023 + + - name: mdifffitid0000027 + run: mDiffFit -d -s 2-fit.000002.000003.txt pposs2ukstu_red_001_002.fits pposs2ukstu_red_002_001.fits 2-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mprojectid0000022 + + - name: mdifffitid0000028 + run: mDiffFit -d -s 2-fit.000002.000004.txt pposs2ukstu_red_001_002.fits pposs2ukstu_red_002_002.fits 2-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mprojectid0000023 + + - name: mdifffitid0000029 + run: mDiffFit -d -s 2-fit.000003.000004.txt pposs2ukstu_red_002_001.fits pposs2ukstu_red_002_002.fits 2-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000022 + - mprojectid0000023 + + - name: mconcatfitid0000030 + run: mConcatFit 2-stat.tbl 2-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000024 + - mdifffitid0000025 + - mdifffitid0000026 + - mdifffitid0000027 + - mdifffitid0000028 + - mdifffitid0000029 + + - name: mbgmodelid0000031 + run: mBgModel -i 100000 2-images.tbl 2-fits.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000030 + + - name: mbackgroundid0000032 + run: mBackground -t pposs2ukstu_red_001_001.fits cposs2ukstu_red_001_001.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mbgmodelid0000031 + + - name: mbackgroundid0000033 + run: mBackground -t pposs2ukstu_red_001_002.fits cposs2ukstu_red_001_002.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mbgmodelid0000031 + + - name: mbackgroundid0000034 + run: mBackground -t pposs2ukstu_red_002_001.fits cposs2ukstu_red_002_001.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000022 + - mbgmodelid0000031 + + - name: mbackgroundid0000035 + run: mBackground -t pposs2ukstu_red_002_002.fits cposs2ukstu_red_002_002.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000023 + - mbgmodelid0000031 + + - name: mimgtblid0000036 + run: mImgtbl . -t 2-corrected.tbl 2-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000032 + - mbackgroundid0000033 + - mbackgroundid0000034 + - mbackgroundid0000035 + + - name: maddid0000037 + run: mAdd -e 2-updated-corrected.tbl region.hdr 2-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000032 + - mbackgroundid0000033 + - mbackgroundid0000034 + - mbackgroundid0000035 + - mimgtblid0000036 + + - name: mviewerid0000038 + run: mViewer -ct 1 -gray 2-mosaic.fits -1s max gaussian -png 2-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000037 + + - name: mprojectid0000039 + run: mProject -X poss2ukstu_ir_001_001.fits pposs2ukstu_ir_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000040 + run: mProject -X poss2ukstu_ir_001_002.fits pposs2ukstu_ir_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000041 + run: mProject -X poss2ukstu_ir_002_001.fits pposs2ukstu_ir_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000042 + run: mProject -X poss2ukstu_ir_002_002.fits pposs2ukstu_ir_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000043 + run: mDiffFit -d -s 3-fit.000001.000002.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_001_002.fits 3-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000040 + + - name: mdifffitid0000044 + run: mDiffFit -d -s 3-fit.000001.000003.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_002_001.fits 3-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000041 + + - name: mdifffitid0000045 + run: mDiffFit -d -s 3-fit.000001.000004.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_002_002.fits 3-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000042 + + - name: mdifffitid0000046 + run: mDiffFit -d -s 3-fit.000002.000003.txt pposs2ukstu_ir_001_002.fits pposs2ukstu_ir_002_001.fits 3-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mprojectid0000041 + + - name: mdifffitid0000047 + run: mDiffFit -d -s 3-fit.000002.000004.txt pposs2ukstu_ir_001_002.fits pposs2ukstu_ir_002_002.fits 3-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mprojectid0000042 + + - name: mdifffitid0000048 + run: mDiffFit -d -s 3-fit.000003.000004.txt pposs2ukstu_ir_002_001.fits pposs2ukstu_ir_002_002.fits 3-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000041 + - mprojectid0000042 + + - name: mconcatfitid0000049 + run: mConcatFit 3-stat.tbl 3-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000043 + - mdifffitid0000044 + - mdifffitid0000045 + - mdifffitid0000046 + - mdifffitid0000047 + - mdifffitid0000048 + + - name: mbgmodelid0000050 + run: mBgModel -i 100000 3-images.tbl 3-fits.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000049 + + - name: mbackgroundid0000051 + run: mBackground -t pposs2ukstu_ir_001_001.fits cposs2ukstu_ir_001_001.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mbgmodelid0000050 + + - name: mbackgroundid0000052 + run: mBackground -t pposs2ukstu_ir_001_002.fits cposs2ukstu_ir_001_002.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mbgmodelid0000050 + + - name: mbackgroundid0000053 + run: mBackground -t pposs2ukstu_ir_002_001.fits cposs2ukstu_ir_002_001.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000041 + - mbgmodelid0000050 + + - name: mbackgroundid0000054 + run: mBackground -t pposs2ukstu_ir_002_002.fits cposs2ukstu_ir_002_002.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000042 + - mbgmodelid0000050 + + - name: mimgtblid0000055 + run: mImgtbl . -t 3-corrected.tbl 3-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000051 + - mbackgroundid0000052 + - mbackgroundid0000053 + - mbackgroundid0000054 + + - name: maddid0000056 + run: mAdd -e 3-updated-corrected.tbl region.hdr 3-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000051 + - mbackgroundid0000052 + - mbackgroundid0000053 + - mbackgroundid0000054 + - mimgtblid0000055 + + - name: mviewerid0000057 + run: mViewer -ct 1 -gray 3-mosaic.fits -1s max gaussian -png 3-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000056 + + - name: mviewerid0000058 + run: mViewer -red 3-mosaic.fits -0.5s max gaussian-log -green 2-mosaic.fits -0.5s max gaussian-log -blue 1-mosaic.fits -0.5s max gaussian-log -png mosaic-color.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000018 + - maddid0000037 + - maddid0000056 diff --git a/pkg/client/resource/schedules/wf-montage-a10.yaml b/pkg/client/resource/schedules/wf-montage-a10.yaml new file mode 100644 index 0000000..920667f --- /dev/null +++ b/pkg/client/resource/schedules/wf-montage-a10.yaml @@ -0,0 +1,461 @@ +name: wf-schedule-montage +spec: + namespace: "akoflow" + runtime: "k8s" + schedule: "schedule1" + storagePolicy: + storageClassName: "local-path" + storageSize: "256Mi" + type: distributed + mountPath: "/data" + image: ovvesley/akoflow-wf-montage:050d + activities: + - name: mprojectid0000001 + run: mProject -X poss2ukstu_blue_001_001.fits pposs2ukstu_blue_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000002 + run: mProject -X poss2ukstu_blue_001_002.fits pposs2ukstu_blue_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000003 + run: mProject -X poss2ukstu_blue_002_001.fits pposs2ukstu_blue_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000004 + run: mProject -X poss2ukstu_blue_002_002.fits pposs2ukstu_blue_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000005 + run: mDiffFit -d -s 1-fit.000001.000002.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_001_002.fits 1-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000002 + + - name: mdifffitid0000006 + run: mDiffFit -d -s 1-fit.000001.000003.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_002_001.fits 1-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000003 + + - name: mdifffitid0000007 + run: mDiffFit -d -s 1-fit.000001.000004.txt pposs2ukstu_blue_001_001.fits pposs2ukstu_blue_002_002.fits 1-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mprojectid0000004 + + - name: mdifffitid0000008 + run: mDiffFit -d -s 1-fit.000002.000003.txt pposs2ukstu_blue_001_002.fits pposs2ukstu_blue_002_001.fits 1-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mprojectid0000003 + + - name: mdifffitid0000009 + run: mDiffFit -d -s 1-fit.000002.000004.txt pposs2ukstu_blue_001_002.fits pposs2ukstu_blue_002_002.fits 1-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mprojectid0000004 + + - name: mdifffitid0000010 + run: mDiffFit -d -s 1-fit.000003.000004.txt pposs2ukstu_blue_002_001.fits pposs2ukstu_blue_002_002.fits 1-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000003 + - mprojectid0000004 + + - name: mconcatfitid0000011 + run: mConcatFit 1-stat.tbl 1-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000005 + - mdifffitid0000006 + - mdifffitid0000007 + - mdifffitid0000008 + - mdifffitid0000009 + - mdifffitid0000010 + + - name: mbgmodelid0000012 + run: mBgModel -i 100000 1-images.tbl 1-fits.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000011 + + - name: mbackgroundid0000013 + run: mBackground -t pposs2ukstu_blue_001_001.fits cposs2ukstu_blue_001_001.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000001 + - mbgmodelid0000012 + + - name: mbackgroundid0000014 + run: mBackground -t pposs2ukstu_blue_001_002.fits cposs2ukstu_blue_001_002.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000002 + - mbgmodelid0000012 + + - name: mbackgroundid0000015 + run: mBackground -t pposs2ukstu_blue_002_001.fits cposs2ukstu_blue_002_001.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000003 + - mbgmodelid0000012 + + - name: mbackgroundid0000016 + run: mBackground -t pposs2ukstu_blue_002_002.fits cposs2ukstu_blue_002_002.fits 1-projected.tbl 1-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000004 + - mbgmodelid0000012 + + - name: mimgtblid0000017 + run: mImgtbl . -t 1-corrected.tbl 1-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000013 + - mbackgroundid0000014 + - mbackgroundid0000015 + - mbackgroundid0000016 + + - name: maddid0000018 + run: mAdd -e 1-updated-corrected.tbl region.hdr 1-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000013 + - mbackgroundid0000014 + - mbackgroundid0000015 + - mbackgroundid0000016 + - mimgtblid0000017 + + - name: mviewerid0000019 + run: mViewer -ct 1 -gray 1-mosaic.fits -1s max gaussian -png 1-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000018 + + - name: mprojectid0000020 + run: mProject -X poss2ukstu_red_001_001.fits pposs2ukstu_red_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000021 + run: mProject -X poss2ukstu_red_001_002.fits pposs2ukstu_red_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000022 + run: mProject -X poss2ukstu_red_002_001.fits pposs2ukstu_red_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000023 + run: mProject -X poss2ukstu_red_002_002.fits pposs2ukstu_red_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000024 + run: mDiffFit -d -s 2-fit.000001.000002.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_001_002.fits 2-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000021 + + - name: mdifffitid0000025 + run: mDiffFit -d -s 2-fit.000001.000003.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_002_001.fits 2-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000022 + + - name: mdifffitid0000026 + run: mDiffFit -d -s 2-fit.000001.000004.txt pposs2ukstu_red_001_001.fits pposs2ukstu_red_002_002.fits 2-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mprojectid0000023 + + - name: mdifffitid0000027 + run: mDiffFit -d -s 2-fit.000002.000003.txt pposs2ukstu_red_001_002.fits pposs2ukstu_red_002_001.fits 2-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mprojectid0000022 + + - name: mdifffitid0000028 + run: mDiffFit -d -s 2-fit.000002.000004.txt pposs2ukstu_red_001_002.fits pposs2ukstu_red_002_002.fits 2-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mprojectid0000023 + + - name: mdifffitid0000029 + run: mDiffFit -d -s 2-fit.000003.000004.txt pposs2ukstu_red_002_001.fits pposs2ukstu_red_002_002.fits 2-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000022 + - mprojectid0000023 + + - name: mconcatfitid0000030 + run: mConcatFit 2-stat.tbl 2-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000024 + - mdifffitid0000025 + - mdifffitid0000026 + - mdifffitid0000027 + - mdifffitid0000028 + - mdifffitid0000029 + + - name: mbgmodelid0000031 + run: mBgModel -i 100000 2-images.tbl 2-fits.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000030 + + - name: mbackgroundid0000032 + run: mBackground -t pposs2ukstu_red_001_001.fits cposs2ukstu_red_001_001.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000020 + - mbgmodelid0000031 + + - name: mbackgroundid0000033 + run: mBackground -t pposs2ukstu_red_001_002.fits cposs2ukstu_red_001_002.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000021 + - mbgmodelid0000031 + + - name: mbackgroundid0000034 + run: mBackground -t pposs2ukstu_red_002_001.fits cposs2ukstu_red_002_001.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000022 + - mbgmodelid0000031 + + - name: mbackgroundid0000035 + run: mBackground -t pposs2ukstu_red_002_002.fits cposs2ukstu_red_002_002.fits 2-projected.tbl 2-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000023 + - mbgmodelid0000031 + + - name: mimgtblid0000036 + run: mImgtbl . -t 2-corrected.tbl 2-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000032 + - mbackgroundid0000033 + - mbackgroundid0000034 + - mbackgroundid0000035 + + - name: maddid0000037 + run: mAdd -e 2-updated-corrected.tbl region.hdr 2-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000032 + - mbackgroundid0000033 + - mbackgroundid0000034 + - mbackgroundid0000035 + - mimgtblid0000036 + + - name: mviewerid0000038 + run: mViewer -ct 1 -gray 2-mosaic.fits -1s max gaussian -png 2-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000037 + + - name: mprojectid0000039 + run: mProject -X poss2ukstu_ir_001_001.fits pposs2ukstu_ir_001_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000040 + run: mProject -X poss2ukstu_ir_001_002.fits pposs2ukstu_ir_001_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000041 + run: mProject -X poss2ukstu_ir_002_001.fits pposs2ukstu_ir_002_001.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mprojectid0000042 + run: mProject -X poss2ukstu_ir_002_002.fits pposs2ukstu_ir_002_002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + + - name: mdifffitid0000043 + run: mDiffFit -d -s 3-fit.000001.000002.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_001_002.fits 3-diff.000001.000002.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000040 + + - name: mdifffitid0000044 + run: mDiffFit -d -s 3-fit.000001.000003.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_002_001.fits 3-diff.000001.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000041 + + - name: mdifffitid0000045 + run: mDiffFit -d -s 3-fit.000001.000004.txt pposs2ukstu_ir_001_001.fits pposs2ukstu_ir_002_002.fits 3-diff.000001.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mprojectid0000042 + + - name: mdifffitid0000046 + run: mDiffFit -d -s 3-fit.000002.000003.txt pposs2ukstu_ir_001_002.fits pposs2ukstu_ir_002_001.fits 3-diff.000002.000003.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mprojectid0000041 + + - name: mdifffitid0000047 + run: mDiffFit -d -s 3-fit.000002.000004.txt pposs2ukstu_ir_001_002.fits pposs2ukstu_ir_002_002.fits 3-diff.000002.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mprojectid0000042 + + - name: mdifffitid0000048 + run: mDiffFit -d -s 3-fit.000003.000004.txt pposs2ukstu_ir_002_001.fits pposs2ukstu_ir_002_002.fits 3-diff.000003.000004.fits region-oversized.hdr + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000041 + - mprojectid0000042 + + - name: mconcatfitid0000049 + run: mConcatFit 3-stat.tbl 3-fits.tbl . + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mdifffitid0000043 + - mdifffitid0000044 + - mdifffitid0000045 + - mdifffitid0000046 + - mdifffitid0000047 + - mdifffitid0000048 + + - name: mbgmodelid0000050 + run: mBgModel -i 100000 3-images.tbl 3-fits.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mconcatfitid0000049 + + - name: mbackgroundid0000051 + run: mBackground -t pposs2ukstu_ir_001_001.fits cposs2ukstu_ir_001_001.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000039 + - mbgmodelid0000050 + + - name: mbackgroundid0000052 + run: mBackground -t pposs2ukstu_ir_001_002.fits cposs2ukstu_ir_001_002.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000040 + - mbgmodelid0000050 + + - name: mbackgroundid0000053 + run: mBackground -t pposs2ukstu_ir_002_001.fits cposs2ukstu_ir_002_001.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000041 + - mbgmodelid0000050 + + - name: mbackgroundid0000054 + run: mBackground -t pposs2ukstu_ir_002_002.fits cposs2ukstu_ir_002_002.fits 3-projected.tbl 3-corrections.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mprojectid0000042 + - mbgmodelid0000050 + + - name: mimgtblid0000055 + run: mImgtbl . -t 3-corrected.tbl 3-updated-corrected.tbl + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000051 + - mbackgroundid0000052 + - mbackgroundid0000053 + - mbackgroundid0000054 + + - name: maddid0000056 + run: mAdd -e 3-updated-corrected.tbl region.hdr 3-mosaic.fits + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - mbackgroundid0000051 + - mbackgroundid0000052 + - mbackgroundid0000053 + - mbackgroundid0000054 + - mimgtblid0000055 + + - name: mviewerid0000057 + run: mViewer -ct 1 -gray 3-mosaic.fits -1s max gaussian -png 3-mosaic.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000056 + + - name: mviewerid0000058 + run: mViewer -red 3-mosaic.fits -0.5s max gaussian-log -green 2-mosaic.fits -0.5s max gaussian-log -blue 1-mosaic.fits -0.5s max gaussian-log -png mosaic-color.png + memoryLimit: 256Mi + cpuLimit: 1.0 + dependsOn: + - maddid0000018 + - maddid0000037 + - maddid0000056 diff --git a/pkg/client/services/install_akoflow_local_service/install_akoflow_local_service.go b/pkg/client/services/install_akoflow_local_service/install_akoflow_local_service.go index af08ebd..fe072fc 100755 --- a/pkg/client/services/install_akoflow_local_service/install_akoflow_local_service.go +++ b/pkg/client/services/install_akoflow_local_service/install_akoflow_local_service.go @@ -10,20 +10,19 @@ import ( ) const ( - commonBuildAddKubernetesRepoCommand = "echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list" - commonBuildAddKubernetesKeyringCommand = "sudo mkdir -p /etc/apt/keyrings && curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg" - commonBuildInstallPackagesCommand = "sudo apt update && sudo apt install -y uidmap apt-transport-https ca-certificates curl gpg kubelet kubeadm kubectl" - commonBuildInstallDockerCommand = "curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh && dockerd-rootless-setuptool.sh install" - commonBuildHoldKubernetesPackagesCommand = "sudo apt-mark hold kubelet kubeadm kubectl" - commonBuildConfigureContainerdCommand = "sudo mkdir -p /etc/containerd && containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd" + commonBuildAddKubernetesRepoCommand = "echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list" + commonBuildAddKubernetesKeyringCommand = "sudo mkdir -p /etc/apt/keyrings && curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg" + commonBuildInstallPackagesCommand = "sudo apt update && sudo apt install -y uidmap apt-transport-https ca-certificates curl gpg containerd kubelet kubeadm kubectl nfs-common" + commonBuildHoldKubernetesPackagesCommand = "sudo apt-mark hold kubelet kubeadm kubectl && sudo sysctl -w net.ipv4.ip_forward=1" + commonBuildConfigureContainerdCommand = "sudo mkdir -p /etc/containerd && containerd config default | sudo tee /etc/containerd/config.toml > /dev/null && sudo sed -i 's/SystemdCgroup = false/SystemdCgroup = true/' /etc/containerd/config.toml && sudo systemctl restart containerd" ) const ( - mainBuildInitializeKubernetes = "sudo kubeadm init" + mainBuildInitializeKubernetes = "sudo kubeadm init --pod-network-cidr=192.168.0.0/16" mainBuildCopyKubeConfig = "mkdir -p $HOME/.kube && sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config && sudo chown $(id -u):$(id -g) $HOME/.kube/config" mainBuildInstallCalico = "kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml" - mainInstallAkoflowKubeAdmin = "kubectl apply -f https://raw.githubusercontent.com/UFFeScience/akoflow/refs/heads/main/pkg/server/resource/akoflow-kubeadmin.yaml" + mainInstallAkoflowKubeAdmin = "kubectl apply -f https://raw.githubusercontent.com/UFFeScience/akoflow/refs/heads/AKF-21/pkg/server/resource/akoflow-dev-dockerdesktop.yaml && kubectl create token akoflow-server-sa --duration=800h --namespace=akoflow" ) type MainHostDTO struct { @@ -57,7 +56,6 @@ func (i *InstallAkoflowLocalService) Install() { commonBuildAddKubernetesRepoCommand, commonBuildAddKubernetesKeyringCommand, commonBuildInstallPackagesCommand, - commonBuildInstallDockerCommand, commonBuildHoldKubernetesPackagesCommand, commonBuildConfigureContainerdCommand, }) @@ -68,10 +66,6 @@ func (i *InstallAkoflowLocalService) Install() { mainHostDTO := i.handleKubernetesInitializationInMainHost(mainHost) i.handleKubernetesJoiningInWorkerNodes(workers, mainHostDTO) - i.sshConnectionService.ExecuteCommandsOnHost(mainHost, []string{ - mainInstallAkoflowKubeAdmin, - }) - i.sshConnectionService.CloseConnections() } @@ -80,6 +74,7 @@ func (i *InstallAkoflowLocalService) handleKubernetesInitializationInMainHost(ma mainBuildInitializeKubernetes, mainBuildCopyKubeConfig, mainBuildInstallCalico, + mainInstallAkoflowKubeAdmin, }) ipAddress := "" diff --git a/pkg/server/config/app_container.go b/pkg/server/config/app_container.go index 43a4aa6..54d5fab 100755 --- a/pkg/server/config/app_container.go +++ b/pkg/server/config/app_container.go @@ -14,8 +14,12 @@ import ( "github.com/ovvesley/akoflow/pkg/server/database/repository/activity_repository" "github.com/ovvesley/akoflow/pkg/server/database/repository/logs_repository" "github.com/ovvesley/akoflow/pkg/server/database/repository/metrics_repository" + "github.com/ovvesley/akoflow/pkg/server/database/repository/node_metrics_repository" + "github.com/ovvesley/akoflow/pkg/server/database/repository/node_repository" "github.com/ovvesley/akoflow/pkg/server/database/repository/runtime_repository" + "github.com/ovvesley/akoflow/pkg/server/database/repository/schedule_repository" "github.com/ovvesley/akoflow/pkg/server/database/repository/storages_repository" + "github.com/ovvesley/akoflow/pkg/server/database/repository/workflow_execution_repository" "github.com/ovvesley/akoflow/pkg/server/database/repository/workflow_repository" ) @@ -37,12 +41,16 @@ type EnvVars struct { } type AppContainerRepository struct { - WorkflowRepository workflow_repository.IWorkflowRepository - ActivityRepository activity_repository.IActivityRepository - LogsRepository logs_repository.ILogsRepository - MetricsRepository metrics_repository.IMetricsRepository - StoragesRepository storages_repository.IStorageRepository - RuntimeRepository runtime_repository.IRuntimeRepository + WorkflowRepository workflow_repository.IWorkflowRepository + ActivityRepository activity_repository.IActivityRepository + LogsRepository logs_repository.ILogsRepository + MetricsRepository metrics_repository.IMetricsRepository + StoragesRepository storages_repository.IStorageRepository + RuntimeRepository runtime_repository.IRuntimeRepository + NodeRepository node_repository.INodeRepository + NodeMetricsRepository node_metrics_repository.INodeMetricsRepository + WorkflowExecutionRepository workflow_execution_repository.IWorkflowExecutionRepository + ScheduleRepository schedule_repository.IScheduleRepository } type AppContainerConnector struct { @@ -58,6 +66,7 @@ type AppContainerTemplateRenderer struct { type AppContainerHttpHelper struct { WriteJson func(w http.ResponseWriter, data interface{}) GetUrlParam func(r *http.Request, key string) string + ReadJson func(r *http.Request, data interface{}) error } // GetEnvVars returns the environment variables as a map @@ -103,6 +112,10 @@ func MakeAppContainer() AppContainer { metricsRepository := metrics_repository.New() storagesRepository := storages_repository.New() runtimeRepository := runtime_repository.New() + nodeRepository := node_repository.New() + nodesMetricsRepository := node_metrics_repository.New() + workflowExecutionRepository := workflow_execution_repository.New() + scheduleRepository := schedule_repository.New() // create the Connector instances k8sConnector := connector_k8s.New() @@ -118,12 +131,16 @@ func MakeAppContainer() AppContainer { appContainer := AppContainer{ DefaultNamespace: DEFAULT_NAMESPACE, Repository: AppContainerRepository{ - WorkflowRepository: workflowRepository, - ActivityRepository: activityRepository, - LogsRepository: logsRepository, - MetricsRepository: metricsRepository, - StoragesRepository: storagesRepository, - RuntimeRepository: runtimeRepository, + WorkflowRepository: workflowRepository, + ActivityRepository: activityRepository, + LogsRepository: logsRepository, + MetricsRepository: metricsRepository, + StoragesRepository: storagesRepository, + RuntimeRepository: runtimeRepository, + NodeRepository: nodeRepository, + NodeMetricsRepository: nodesMetricsRepository, + WorkflowExecutionRepository: workflowExecutionRepository, + ScheduleRepository: scheduleRepository, }, Connector: AppContainerConnector{ K8sConnector: k8sConnector, @@ -136,6 +153,7 @@ func MakeAppContainer() AppContainer { HttpHelper: AppContainerHttpHelper{ WriteJson: http_helper.WriteJson, GetUrlParam: http_helper.GetUrlPathParam, + ReadJson: http_helper.ReadJson, }, Logger: logger, EnvVars: EnvVars{ diff --git a/pkg/server/config/config.go b/pkg/server/config/config.go index 7fd2aa3..38d8821 100755 --- a/pkg/server/config/config.go +++ b/pkg/server/config/config.go @@ -45,7 +45,9 @@ func SetupEnv() { os.Setenv("K8S_API_SERVER_HOST", hostEnvByKube) } - os.Setenv("K8S_API_SERVER_TOKEN", tokenData) + if tokenData != "" { + os.Setenv("K8S_API_SERVER_TOKEN", tokenData) + } } diff --git a/pkg/server/config/http_helper/http_helper.go b/pkg/server/config/http_helper/http_helper.go index 7c49b95..462473d 100755 --- a/pkg/server/config/http_helper/http_helper.go +++ b/pkg/server/config/http_helper/http_helper.go @@ -67,3 +67,19 @@ func GetPatternFromRequest(r *http.Request) string { return patternStr } + +func ReadJson(r *http.Request, data interface{}) error { + if r.Body == nil { + return fmt.Errorf("request body is empty") + } + + decoder := json.NewDecoder(r.Body) + decoder.DisallowUnknownFields() // Prevents unknown fields from being included in the JSON + + err := decoder.Decode(data) + if err != nil { + return fmt.Errorf("error decoding JSON: %w", err) + } + + return nil +} diff --git a/pkg/server/connector/connector_k8s/connector_k8s.go b/pkg/server/connector/connector_k8s/connector_k8s.go index ed250d9..c11a5aa 100755 --- a/pkg/server/connector/connector_k8s/connector_k8s.go +++ b/pkg/server/connector/connector_k8s/connector_k8s.go @@ -11,6 +11,7 @@ import ( "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_job_k8s" "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_metrics_k8s" "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_namespace_k8s" + "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_node_k8s" "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_pod_k8s" "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_pvc_k8s" "github.com/ovvesley/akoflow/pkg/server/connector/connector_k8s/connector_role" @@ -82,6 +83,8 @@ type IConnector interface { // HealthCheck checks the health of the Kubernetes API. // API Endpoint: /healthz Healthz(*runtime_entity.Runtime) connector_healthz.IConnectorHealthz + + Nodes(*runtime_entity.Runtime) connector_node_k8s.IConnectorNodeK8s } func NewClient() *http.Client { @@ -154,3 +157,7 @@ func (c *Connector) StorageClass(r *runtime_entity.Runtime) connector_storage_cl func (c *Connector) Healthz(r *runtime_entity.Runtime) connector_healthz.IConnectorHealthz { return connector_healthz.New(r) } + +func (c *Connector) Nodes(r *runtime_entity.Runtime) connector_node_k8s.IConnectorNodeK8s { + return connector_node_k8s.New(r) +} diff --git a/pkg/server/connector/connector_k8s/connector_metrics_k8s/connector_metrics_k8s.go b/pkg/server/connector/connector_k8s/connector_metrics_k8s/connector_metrics_k8s.go index 58c7559..4bd3364 100755 --- a/pkg/server/connector/connector_k8s/connector_metrics_k8s/connector_metrics_k8s.go +++ b/pkg/server/connector/connector_k8s/connector_metrics_k8s/connector_metrics_k8s.go @@ -19,6 +19,7 @@ type ConnectorMetricsK8s struct { type IConnectorMetrics interface { ListMetrics() GetPodMetrics(namespace string, podName string) (ResponseGetPodMetrics, error) + GetNodeMetrics() ([]k8sNodeMetrics, error) } func New(runtime *runtime_entity.Runtime) IConnectorMetrics { @@ -120,3 +121,67 @@ func (c *ConnectorMetricsK8s) GetPodMetrics(namespace string, podName string) (R return result, nil } + +type k8sNodeMetrics struct { + Name string `json:"name"` + CPU string `json:"cpu"` + Memory string `json:"memory"` +} + +func (c *ConnectorMetricsK8s) GetNodeMetrics() ([]k8sNodeMetrics, error) { + token := c.runtime.GetMetadataApiServerToken() + host := c.runtime.GetMetadataApiServerHost() + + req, _ := http.NewRequest("GET", "https://"+host+"/apis/metrics.k8s.io/v1beta1/nodes", nil) + req.Header.Set("Authorization", "Bearer "+token) + + resp, err := c.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != 200 { + return nil, fmt.Errorf("metric server request failed: %d", resp.StatusCode) + } + + // Estrutura mínima do retorno da API + var raw struct { + Items []struct { + Metadata struct { + Name string `json:"name"` + } `json:"metadata"` + Usage struct { + CPU string `json:"cpu"` + Memory string `json:"memory"` + } `json:"usage"` + } `json:"items"` + } + + if err := json.NewDecoder(resp.Body).Decode(&raw); err != nil { + return nil, err + } + + // Monta lista no formato desejado + var metrics []k8sNodeMetrics + for _, item := range raw.Items { + metrics = append(metrics, k8sNodeMetrics{ + Name: item.Metadata.Name, + CPU: item.Usage.CPU, + Memory: item.Usage.Memory, + }) + } + + return metrics, nil +} + +func (n k8sNodeMetrics) GetCpuUsage() float64 { + var cpuUsage float64 + fmt.Sscanf(n.CPU, "%f", &cpuUsage) + return cpuUsage / 1000000000 +} +func (n k8sNodeMetrics) GetMemoryUsage() float64 { + var memoryUsage float64 + fmt.Sscanf(n.Memory, "%f", &memoryUsage) + return memoryUsage +} diff --git a/pkg/server/connector/connector_k8s/connector_node_k8s/connector_node.go b/pkg/server/connector/connector_k8s/connector_node_k8s/connector_node.go new file mode 100644 index 0000000..61eb9f2 --- /dev/null +++ b/pkg/server/connector/connector_k8s/connector_node_k8s/connector_node.go @@ -0,0 +1,162 @@ +package connector_node_k8s + +import ( + "crypto/tls" + "encoding/json" + "net/http" + + "github.com/ovvesley/akoflow/pkg/server/entities/runtime_entity" +) + +type ConnectorNodeK8s struct { + client *http.Client + runtime *runtime_entity.Runtime +} + +type IConnectorNodeK8s interface { + ListNodes() ConnectorNodeK8sResponse +} + +func New(runtime *runtime_entity.Runtime) IConnectorNodeK8s { + return &ConnectorNodeK8s{ + client: newClient(), + runtime: runtime, + } +} + +func newClient() *http.Client { + return &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{ + InsecureSkipVerify: true, + }, + }, + } +} + +type Node struct { + Name string `json:"name"` + Namespace string `json:"namespace"` + Status string `json:"status"` + CpuMax string `json:"cpu_max"` + MemoryMax string `json:"memory_max"` + NetworkMax string `json:"network_max"` + DiskMax string `json:"disk_max"` + OsImage string `json:"os_image"` + CreatedAt string `json:"created_at"` +} + +func (n Node) GetCpuMax() float64 { + cpuMax := n.CpuMax + if cpuMax == "" { + return 0.0 + } + var cpu float64 + if err := json.Unmarshal([]byte(cpuMax), &cpu); err != nil { + return 0.0 + } + return cpu +} + +func (n Node) GetNodeMemoryMax() float64 { + memoryMax := n.MemoryMax + if memoryMax == "" { + return 0.0 + } + if len(memoryMax) > 2 && memoryMax[len(memoryMax)-2:] == "Ki" { + memoryMax = memoryMax[:len(memoryMax)-2] + } + var memory float64 + if err := json.Unmarshal([]byte(memoryMax), &memory); err != nil { + return 0.0 + } + return memory / 1024.0 +} + +func (n Node) GetNodeNetworkMax() float64 { + networkMax := n.NetworkMax + if networkMax == "" { + return 0.0 + } + var network float64 + if err := json.Unmarshal([]byte(networkMax), &network); err != nil { + return 0.0 + } + return network +} + +type ConnectorNodeK8sResponse struct { + Success bool `json:"success"` + Message string `json:"message"` + Data []Node `json:"data,omitempty"` +} + +func (c ConnectorNodeK8s) ListNodes() ConnectorNodeK8sResponse { + host := c.runtime.GetMetadataApiServerHost() + + req, err := http.NewRequest("GET", "https://"+host+"/api/v1/nodes", nil) + + if err != nil { + return ConnectorNodeK8sResponse{ + Success: false, + Message: "Failed to create request: " + err.Error(), + } + } + + req.Header.Set("Authorization", "Bearer "+c.runtime.GetMetadataApiServerToken()) + + resp, err := c.client.Do(req) + if err != nil { + return ConnectorNodeK8sResponse{ + Success: false, + Message: "Failed to execute request: " + err.Error(), + } + } + + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + return ConnectorNodeK8sResponse{ + Success: false, + Message: "Failed to list nodes, status code: " + resp.Status, + } + } + + var data any + + if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { + return ConnectorNodeK8sResponse{ + Success: false, + Message: "Failed to decode response: " + err.Error(), + } + } + + var nodes []Node + for _, item := range data.(map[string]interface{})["items"].([]interface{}) { + name := item.(map[string]interface{})["metadata"].(map[string]interface{})["name"].(string) + memoryMax := item.(map[string]interface{})["status"].(map[string]interface{})["allocatable"].(map[string]interface{})["memory"] + cpuMax := item.(map[string]interface{})["status"].(map[string]interface{})["allocatable"].(map[string]interface{})["cpu"] + networkMax := item.(map[string]interface{})["status"].(map[string]interface{})["allocatable"].(map[string]interface{})["ephemeral-storage"] + DiskMax := item.(map[string]interface{})["status"].(map[string]interface{})["capacity"].(map[string]interface{})["ephemeral-storage"] + osImage := item.(map[string]interface{})["status"].(map[string]interface{})["nodeInfo"].(map[string]interface{})["osImage"].(string) + createdAt := item.(map[string]interface{})["metadata"].(map[string]interface{})["creationTimestamp"].(string) + + nodes = append(nodes, Node{ + Name: name, + Status: "Ready", // Assuming all nodes are ready, adjust as needed + CpuMax: cpuMax.(string), + MemoryMax: memoryMax.(string), + NetworkMax: networkMax.(string), + DiskMax: DiskMax.(string), + OsImage: osImage, + CreatedAt: createdAt, + }) + + } + + return ConnectorNodeK8sResponse{ + Success: true, + Message: "Nodes listed successfully", + Data: nodes, + } + +} diff --git a/pkg/server/database/model/activity_model.go b/pkg/server/database/model/activity_model.go index c9d1e8e..bfb8085 100644 --- a/pkg/server/database/model/activity_model.go +++ b/pkg/server/database/model/activity_model.go @@ -12,6 +12,7 @@ type Activity struct { ResourceK8sBase64 string `db:"resource_k8s_base64"` Status int `db:"status"` ProcID string `db:"proc_id"` + NodeSelector string `db:"node_selector"` CreatedAt string `db:"created_at"` StartedAt string `db:"started_at"` FinishedAt string `db:"finished_at"` diff --git a/pkg/server/database/model/activity_schedule.go b/pkg/server/database/model/activity_schedule.go new file mode 100644 index 0000000..f9c5377 --- /dev/null +++ b/pkg/server/database/model/activity_schedule.go @@ -0,0 +1,35 @@ +package model + +import "github.com/ovvesley/akoflow/pkg/server/database" + +type ActivitySchedule struct { + ID int `db:"id" sql:"INTEGER PRIMARY KEY AUTOINCREMENT"` + WorkflowID int `db:"workflow_id"` + ActivityID int `db:"activity_id"` + NodeName string `db:"node_name"` + ScheduleName string `db:"schedule_name"` + CpuRequired float64 `db:"cpu_required"` + MemoryRequired float64 `db:"memory_required"` + Metadata string `db:"metadata"` // {"cpu", "memory", "score"} + CreatedAt string `db:"created_at"` +} + +func (ActivitySchedule) TableName() string { + return "activities_schedules" +} + +func (a ActivitySchedule) GetColumns() []string { + return database.GenericGetColumns(a) +} + +func (a ActivitySchedule) GetPrimaryKey() string { + return database.GenericGetPrimaryKey(a) +} + +func (a ActivitySchedule) GetClausulePrimaryKey() string { + return database.GenericGetClausulePrimaryKey(a) +} + +func (a ActivitySchedule) GetColumnType(column string) string { + return database.GenericGetColumnType(a, column) +} diff --git a/pkg/server/database/model/node_metrics_model.go b/pkg/server/database/model/node_metrics_model.go new file mode 100644 index 0000000..679ce67 --- /dev/null +++ b/pkg/server/database/model/node_metrics_model.go @@ -0,0 +1,35 @@ +package model + +import "github.com/ovvesley/akoflow/pkg/server/database" + +type NodeMetrics struct { + ID int `db:"id" sql:"INTEGER PRIMARY KEY AUTOINCREMENT"` + NodeID int `db:"node_id"` + CpuUsage float64 `db:"cpu_usage"` + CpuMemory float64 `db:"cpu_memory"` + MemoryUsage float64 `db:"memory_usage"` + MemoryLimit float64 `db:"memory_limit"` + NetworkUsage float64 `db:"network_usage"` + NetworkLimit float64 `db:"network_limit"` + Timestamp string `db:"timestamp"` +} + +func (NodeMetrics) TableName() string { + return "nodes_metrics" +} + +func (n NodeMetrics) GetColumns() []string { + return database.GenericGetColumns(n) +} + +func (n NodeMetrics) GetPrimaryKey() string { + return database.GenericGetPrimaryKey(n) +} + +func (n NodeMetrics) GetClausulePrimaryKey() string { + return database.GenericGetClausulePrimaryKey(n) +} + +func (n NodeMetrics) GetColumnType(column string) string { + return database.GenericGetColumnType(n, column) +} diff --git a/pkg/server/database/model/node_model.go b/pkg/server/database/model/node_model.go new file mode 100644 index 0000000..986aa46 --- /dev/null +++ b/pkg/server/database/model/node_model.go @@ -0,0 +1,63 @@ +package model + +import "github.com/ovvesley/akoflow/pkg/server/database" + +type Node struct { + Name string `db:"name" sql:"TEXT NOT NULL UNIQUE"` + Runtime string `db:"runtime" sql:"TEXT NOT NULL"` + Status int `db:"status" sql:"INTEGER NOT NULL"` + CPUUsage float64 `db:"cpu_usage"` + CPUMax float64 `db:"cpu_max"` + MemoryUsage float64 `db:"memory_usage"` + MemoryLimit float64 `db:"memory_limit"` + NetworkLimit float64 `db:"network_limit"` + NetworkUsage float64 `db:"network_usage"` + CreatedAt string `db:"created_at"` + UpdatedAt string `db:"updated_at"` +} + +func (Node) TableName() string { + return "nodes" +} + +func (n Node) GetColumns() []string { + return database.GenericGetColumns(n) +} + +func (n Node) GetPrimaryKey() string { + return database.GenericGetPrimaryKey(n) +} + +func (n Node) GetClausulePrimaryKey() string { + return database.GenericGetClausulePrimaryKey(n) +} + +func (n Node) GetColumnType(column string) string { + return database.GenericGetColumnType(n, column) +} + +func (n Node) GetMemoryFree() float64 { + if n.MemoryLimit == 0 { + return 0 + } + return n.MemoryLimit - n.MemoryUsage +} + +func (n Node) GetCPUFree() float64 { + if n.CPUMax == 0 { + return 0 + } + return n.CPUMax - n.CPUUsage +} + +func (n Node) GetMemoryMax() float64 { + return n.MemoryLimit +} + +func (n Node) GetCpuAvailable() float64 { + return n.CPUMax +} + +func (n Node) GetName() string { + return n.Name +} diff --git a/pkg/server/database/model/runtime_model.go b/pkg/server/database/model/runtime_model.go index dee9027..dd37645 100644 --- a/pkg/server/database/model/runtime_model.go +++ b/pkg/server/database/model/runtime_model.go @@ -6,6 +6,7 @@ type Runtime struct { Name string `db:"name" sql:"TEXT PRIMARY KEY"` Status int `db:"status"` Metadata string `db:"metadata"` + MaxNodes int `db:"max_nodes"` CreatedAt string `db:"created_at"` UpdatedAt string `db:"updated_at"` DeletedAt string `db:"deleted_at"` diff --git a/pkg/server/database/model/schedule_model.go b/pkg/server/database/model/schedule_model.go new file mode 100644 index 0000000..acf6ad7 --- /dev/null +++ b/pkg/server/database/model/schedule_model.go @@ -0,0 +1,33 @@ +package model + +import "github.com/ovvesley/akoflow/pkg/server/database" + +type ScheduleModel struct { + ID int `db:"id" sql:"INTEGER PRIMARY KEY AUTOINCREMENT"` + Type string `db:"type"` + Code string `db:"code"` + Name string `db:"name"` + PluginSoPath string `db:"plugin_so_path"` + CreatedAt string `db:"created_at"` + UpdatedAt string `db:"updated_at"` +} + +func (ScheduleModel) TableName() string { + return "schedules" +} + +func (w ScheduleModel) GetColumns() []string { + return database.GenericGetColumns(w) +} + +func (w ScheduleModel) GetPrimaryKey() string { + return database.GenericGetPrimaryKey(w) +} + +func (w ScheduleModel) GetClausulePrimaryKey() string { + return database.GenericGetClausulePrimaryKey(w) +} + +func (w ScheduleModel) GetColumnType(column string) string { + return database.GenericGetColumnType(w, column) +} diff --git a/pkg/server/database/model/workflow_execution_model.go b/pkg/server/database/model/workflow_execution_model.go new file mode 100644 index 0000000..a937327 --- /dev/null +++ b/pkg/server/database/model/workflow_execution_model.go @@ -0,0 +1,35 @@ +package model + +import "github.com/ovvesley/akoflow/pkg/server/database" + +type WorkflowExecution struct { + ID int `db:"id" sql:"INTEGER PRIMARY KEY AUTOINCREMENT"` + Namespace string `db:"namespace"` + Name string `db:"name"` + WorkflowID int `db:"workflow_id"` + Status string `db:"status"` + Runtime string `db:"runtime"` + CreatedAt string `db:"created_at"` + UpdatedAt string `db:"updated_at"` + DeletedAt string `db:"deleted_at"` +} + +func (WorkflowExecution) TableName() string { + return "workflow_executions" +} + +func (w WorkflowExecution) GetColumns() []string { + return database.GenericGetColumns(w) +} + +func (w WorkflowExecution) GetPrimaryKey() string { + return database.GenericGetPrimaryKey(w) +} + +func (w WorkflowExecution) GetClausulePrimaryKey() string { + return database.GenericGetClausulePrimaryKey(w) +} + +func (w WorkflowExecution) GetColumnType(column string) string { + return database.GenericGetColumnType(w, column) +} diff --git a/pkg/server/database/repository/activity_repository/activity_repository.go b/pkg/server/database/repository/activity_repository/activity_repository.go index b496705..025c436 100755 --- a/pkg/server/database/repository/activity_repository/activity_repository.go +++ b/pkg/server/database/repository/activity_repository/activity_repository.go @@ -11,6 +11,7 @@ type ActivityRepository struct { tableNameActivity string tableNameActivityDependencies string tableNamePreActivity string + tableNameActivitySchedule string } var StatusCreated = 0 @@ -18,15 +19,6 @@ var StatusRunning = 1 var StatusFinished = 2 var StatusCompleted = 3 -var TableNameActivities = "activities" -var ColumnsActivities = "(id INTEGER PRIMARY KEY AUTOINCREMENT, workflow_id INTEGER, namespace TEXT, name TEXT, image TEXT, resource_k8s_base64 TEXT, status INTEGER, proc_id TEXT, created_at TEXT, started_at TEXT, finished_at TEXT)" - -var TableNameActivitiesDependencies = "activities_dependencies" -var ColumnsActivitiesDependencies = "(id INTEGER PRIMARY KEY AUTOINCREMENT, workflow_id INTEGER, activity_id INTEGER, depend_on_activity INTEGER)" - -var TableNamePreActivities = "pre_activities" -var ColumnsPreActivities = "(id INTEGER PRIMARY KEY AUTOINCREMENT, activity_id INTEGER, workflow_id INTEGER, namespace TEXT, name TEXT, resource_k8s_base64 TXT, status INTEGER, log TEXT)" - func New() IActivityRepository { database := repository.Database{} @@ -48,6 +40,13 @@ func New() IActivityRepository { c = database.Connect() err = repository.CreateOrVerifyTable(c, model.PreActivity{}) + if err != nil { + return nil + } + c.Close() + + c = database.Connect() + err = repository.CreateOrVerifyTable(c, model.ActivitySchedule{}) if err != nil { return nil } @@ -58,9 +57,10 @@ func New() IActivityRepository { } return &ActivityRepository{ - tableNameActivity: TableNameActivities, - tableNameActivityDependencies: TableNameActivitiesDependencies, - tableNamePreActivity: TableNamePreActivities, + tableNameActivity: model.Activity{}.TableName(), + tableNameActivityDependencies: model.ActivityDependency{}.TableName(), + tableNamePreActivity: model.PreActivity{}.TableName(), + tableNameActivitySchedule: model.ActivitySchedule{}.TableName(), } } @@ -75,4 +75,10 @@ type IActivityRepository interface { FindPreActivity(id int) (workflow_activity_entity.WorkflowPreActivityDatabase, error) UpdatePreActivity(id int, preactivity workflow_activity_entity.WorkflowPreActivityDatabase) error GetPreactivitiesCompleted() ([]workflow_activity_entity.WorkflowPreActivityDatabase, error) + UpdateNodeSelector(id int, nodeSelector string) error + SetActivitySchedule(workflowId int, activity int, nodeName string, scheduleName string, cpuRequired float64, memoryRequired float64, metadata string) error + GetActivityScheduleByNodeName(nodeName string) ([]model.ActivitySchedule, error) + GetAllRunningActivities() ([]workflow_activity_entity.WorkflowActivities, error) + GetActivityScheduleByActivityId(activityId int) (model.ActivitySchedule, error) + IsActivityScheduled(workflowId int, activityId int) (bool, error) } diff --git a/pkg/server/database/repository/activity_repository/activity_repository_activity_schedule.go b/pkg/server/database/repository/activity_repository/activity_repository_activity_schedule.go new file mode 100644 index 0000000..b720604 --- /dev/null +++ b/pkg/server/database/repository/activity_repository/activity_repository_activity_schedule.go @@ -0,0 +1,116 @@ +package activity_repository + +import ( + "github.com/ovvesley/akoflow/pkg/server/database/model" + "github.com/ovvesley/akoflow/pkg/server/database/repository" +) + +func (w *ActivityRepository) SetActivitySchedule(workflowId int, activityId int, nodeName string, scheduleName string, cpuRequired float64, memoryRequired float64, metadata string) error { + database := repository.Database{} + c := database.Connect() + + _, err := c.Exec( + "INSERT INTO "+w.tableNameActivitySchedule+" (workflow_id, activity_id, node_name, schedule_name, cpu_required, memory_required, metadata, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, datetime('now'))", + workflowId, + activityId, + nodeName, + scheduleName, + cpuRequired, + memoryRequired, + metadata, + ) + + if err != nil { + return err + } + + err = c.Close() + if err != nil { + return err + } + + return nil +} + +func (w *ActivityRepository) GetActivityScheduleByNodeName(nodeName string) ([]model.ActivitySchedule, error) { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + var activitySchedules []model.ActivitySchedule + rows, err := c.Query("SELECT id, workflow_id, activity_id, node_name, schedule_name, cpu_required, memory_required, metadata, created_at FROM "+w.tableNameActivitySchedule+" WHERE node_name = ?", nodeName) + if err != nil { + return nil, err + } + defer rows.Close() + + for rows.Next() { + var activitySchedule model.ActivitySchedule + err = rows.Scan( + &activitySchedule.ID, + &activitySchedule.WorkflowID, + &activitySchedule.ActivityID, + &activitySchedule.NodeName, + &activitySchedule.ScheduleName, + &activitySchedule.CpuRequired, + &activitySchedule.MemoryRequired, + &activitySchedule.Metadata, + &activitySchedule.CreatedAt, + ) + if err != nil { + return nil, err + } + activitySchedules = append(activitySchedules, activitySchedule) + } + + return activitySchedules, nil +} + +func (w *ActivityRepository) GetActivityScheduleByActivityId(activityId int) (model.ActivitySchedule, error) { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + var activitySchedules []model.ActivitySchedule + rows, err := c.Query("SELECT id, workflow_id, activity_id, node_name, schedule_name, cpu_required, memory_required, metadata, created_at FROM "+w.tableNameActivitySchedule+" WHERE activity_id = ?", activityId) + if err != nil { + return model.ActivitySchedule{}, err + } + defer rows.Close() + for rows.Next() { + var activitySchedule model.ActivitySchedule + err = rows.Scan( + &activitySchedule.ID, + &activitySchedule.WorkflowID, + &activitySchedule.ActivityID, + &activitySchedule.NodeName, + &activitySchedule.ScheduleName, + &activitySchedule.CpuRequired, + &activitySchedule.MemoryRequired, + &activitySchedule.Metadata, + &activitySchedule.CreatedAt, + ) + if err != nil { + return model.ActivitySchedule{}, err + } + activitySchedules = append(activitySchedules, activitySchedule) + } + if len(activitySchedules) == 0 { + return model.ActivitySchedule{}, nil // No activity schedule found for the given activity ID + } + return activitySchedules[0], nil // Return the first activity schedule found +} + +func (w *ActivityRepository) IsActivityScheduled(workflowId int, activityId int) (bool, error) { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + var count int + err := c.QueryRow("SELECT COUNT(*) FROM "+w.tableNameActivitySchedule+" WHERE workflow_id = ? AND activity_id = ?", workflowId, activityId).Scan(&count) + if err != nil { + return false, err + } + + return count > 0, nil +} diff --git a/pkg/server/database/repository/activity_repository/activity_repository_find.go b/pkg/server/database/repository/activity_repository/activity_repository_find.go index 525d932..91718bc 100755 --- a/pkg/server/database/repository/activity_repository/activity_repository_find.go +++ b/pkg/server/database/repository/activity_repository/activity_repository_find.go @@ -9,14 +9,14 @@ func (w *ActivityRepository) Find(id int) (workflow_activity_entity.WorkflowActi database := repository.Database{} c := database.Connect() - rows, err := c.Query("SELECT id, workflow_id, namespace, name, image, runtime, resource_k8s_base64, status, proc_id FROM "+w.tableNameActivity+" WHERE id = ?", id) + rows, err := c.Query("SELECT id, workflow_id, namespace, name, image, runtime, resource_k8s_base64, status, proc_id, node_selector FROM "+w.tableNameActivity+" WHERE id = ?", id) if err != nil { return workflow_activity_entity.WorkflowActivities{}, err } var wfaDatabase workflow_activity_entity.WorkflowActivityDatabase for rows.Next() { - err = rows.Scan(&wfaDatabase.Id, &wfaDatabase.WorkflowId, &wfaDatabase.Namespace, &wfaDatabase.Name, &wfaDatabase.Image, &wfaDatabase.Runtime, &wfaDatabase.ResourceK8sBase64, &wfaDatabase.Status, &wfaDatabase.ProcId) + err = rows.Scan(&wfaDatabase.Id, &wfaDatabase.WorkflowId, &wfaDatabase.Namespace, &wfaDatabase.Name, &wfaDatabase.Image, &wfaDatabase.Runtime, &wfaDatabase.ResourceK8sBase64, &wfaDatabase.Status, &wfaDatabase.ProcId, &wfaDatabase.NodeSelector) if err != nil { return workflow_activity_entity.WorkflowActivities{}, err } diff --git a/pkg/server/database/repository/activity_repository/activity_repository_get_workflow_id.go b/pkg/server/database/repository/activity_repository/activity_repository_get_workflow_id.go index 04aca84..6807568 100755 --- a/pkg/server/database/repository/activity_repository/activity_repository_get_workflow_id.go +++ b/pkg/server/database/repository/activity_repository/activity_repository_get_workflow_id.go @@ -35,3 +35,34 @@ func (w *ActivityRepository) GetByWorkflowId(id int) ([]workflow_activity_entity return activities, nil } + +func (w *ActivityRepository) GetAllRunningActivities() ([]workflow_activity_entity.WorkflowActivities, error) { + database := repository.Database{} + c := database.Connect() + + rows, err := c.Query("SELECT id, workflow_id, namespace, name, image, runtime, resource_k8s_base64, status FROM "+w.tableNameActivity+" WHERE status = ?", StatusRunning) + if err != nil { + return []workflow_activity_entity.WorkflowActivities{}, err + } + + var activities []workflow_activity_entity.WorkflowActivities + var wfaDatabase workflow_activity_entity.WorkflowActivityDatabase + for rows.Next() { + err = rows.Scan(&wfaDatabase.Id, &wfaDatabase.WorkflowId, &wfaDatabase.Namespace, &wfaDatabase.Name, &wfaDatabase.Image, &wfaDatabase.Runtime, &wfaDatabase.ResourceK8sBase64, &wfaDatabase.Status) + if err != nil { + return []workflow_activity_entity.WorkflowActivities{}, err + } + + activity := workflow_activity_entity.DatabaseToWorkflowActivities(workflow_activity_entity.ParamsDatabaseToWorkflowActivities{WorkflowActivityDatabase: wfaDatabase}) + activities = append(activities, activity) + + } + + err = c.Close() + if err != nil { + return []workflow_activity_entity.WorkflowActivities{}, err + } + + return activities, nil + +} diff --git a/pkg/server/database/repository/activity_repository/activity_repository_update_status.go b/pkg/server/database/repository/activity_repository/activity_repository_update_status.go index c24265d..cb90fcf 100755 --- a/pkg/server/database/repository/activity_repository/activity_repository_update_status.go +++ b/pkg/server/database/repository/activity_repository/activity_repository_update_status.go @@ -53,3 +53,21 @@ func (w *ActivityRepository) UpdateProcID(id int, pid string) error { return nil } + +func (w *ActivityRepository) UpdateNodeSelector(id int, nodeSelector string) error { + database := repository.Database{} + c := database.Connect() + + _, err := c.Exec("UPDATE "+w.tableNameActivity+" SET node_selector = ? WHERE ID = ?", nodeSelector, id) + if err != nil { + return err + } + + err = c.Close() + + if err != nil { + return err + } + + return nil +} diff --git a/pkg/server/database/repository/node_metrics_repository/node_metrics_repository.go b/pkg/server/database/repository/node_metrics_repository/node_metrics_repository.go new file mode 100644 index 0000000..2251c38 --- /dev/null +++ b/pkg/server/database/repository/node_metrics_repository/node_metrics_repository.go @@ -0,0 +1,85 @@ +package node_metrics_repository + +import ( + "github.com/ovvesley/akoflow/pkg/server/database/model" + "github.com/ovvesley/akoflow/pkg/server/database/repository" +) + +type NodeMetricsRepository struct { + tableName string +} + +const STATUS_READY = 1 +const STATUS_NOT_READY = 0 + +type INodeMetricsRepository interface { + CreateOrUpdate(name string, status int, metadata map[string]string) + Create(params ParamsNodeMetricsCreate) error +} + +func New() INodeMetricsRepository { + + database := repository.Database{} + model := model.NodeMetrics{} + c := database.Connect() + err := repository.CreateOrVerifyTable(c, model) + if err != nil { + return nil + } + + err = c.Close() + if err != nil { + return nil + } + + return &NodeMetricsRepository{ + tableName: model.TableName(), + } +} + +func (nmr *NodeMetricsRepository) CreateOrUpdate(name string, status int, metadata map[string]string) { + // Implementation for creating or updating a node metrics entry + // This would typically involve inserting or updating the record in the database + // using the provided name, status, and metadata. + +} + +func (nmr *NodeMetricsRepository) Create(params ParamsNodeMetricsCreate) error { + database := repository.Database{} + c := database.Connect() + + _, err := c.Exec( + "INSERT INTO "+nmr.tableName+" (node_id, cpu_usage, cpu_memory, memory_usage, memory_limit, network_usage, network_limit, timestamp) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", + params.NodeMetricsDatabase.NodeID, + params.NodeMetricsDatabase.CpuUsage, + params.NodeMetricsDatabase.CpuMemory, + params.NodeMetricsDatabase.MemoryUsage, + params.NodeMetricsDatabase.MemoryLimit, + params.NodeMetricsDatabase.NetworkUsage, + params.NodeMetricsDatabase.NetworkLimit, + params.NodeMetricsDatabase.Timestamp) + if err != nil { + return err + } + + err = c.Close() + if err != nil { + return err + } + + return nil +} + +type ParamsNodeMetricsCreate struct { + NodeMetricsDatabase NodeMetricsDatabase +} +type NodeMetricsDatabase struct { + NodeID string + CpuUsage string + CpuMemory string + MemoryUsage string + MemoryLimit string + NetworkUsage string + NetworkLimit string + Timestamp string +} diff --git a/pkg/server/database/repository/node_repository/node_repository.go b/pkg/server/database/repository/node_repository/node_repository.go new file mode 100644 index 0000000..dfd10f0 --- /dev/null +++ b/pkg/server/database/repository/node_repository/node_repository.go @@ -0,0 +1,174 @@ +package node_repository + +import ( + "strings" + + "github.com/ovvesley/akoflow/pkg/server/database/model" + "github.com/ovvesley/akoflow/pkg/server/database/repository" +) + +type NodeRepository struct { + tableName string +} + +const STATUS_READY = 1 +const STATUS_NOT_READY = 0 + +type INodeRepository interface { + CreateOrUpdate(runtime string, node model.Node) error + GetByName(name string) (*model.Node, error) + UpdateNode(node model.Node) error + GetNodesByRuntime(runtime string) ([]model.Node, error) +} + +func New() INodeRepository { + + database := repository.Database{} + model := model.Node{} + c := database.Connect() + err := repository.CreateOrVerifyTable(c, model) + if err != nil { + return nil + } + + err = c.Close() + if err != nil { + return nil + } + + return &NodeRepository{ + tableName: model.TableName(), + } +} + +func (nr *NodeRepository) GetByName(name string) (*model.Node, error) { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + var node model.Node + cols := node.GetColumns() + rows, err := c.Query("SELECT "+strings.Join(cols, ", ")+" FROM "+nr.tableName+" WHERE name = ?", name) + if err != nil { + return nil, err + } + defer rows.Close() + + if rows.Next() { + err = rows.Scan( + &node.Name, + &node.Runtime, + &node.Status, + &node.CPUUsage, + &node.CPUMax, + &node.MemoryUsage, + &node.MemoryLimit, + &node.NetworkLimit, + &node.NetworkUsage, + &node.CreatedAt, + &node.UpdatedAt, + ) + + if err != nil { + return nil, err + } + return &node, nil + } + + return nil, nil // Node not found + +} + +func (nr *NodeRepository) UpdateNode(node model.Node) error { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + // Prepare the update statement + stmt, err := c.Prepare("UPDATE " + nr.tableName + " SET status = ?, cpu_usage = ?, cpu_max = ?, memory_usage = ?, memory_limit = ?, network_limit = ?, network_usage = ?, updated_at = datetime('now') WHERE name = ?") + if err != nil { + return err + } + defer stmt.Close() + + // Execute the update statement + _, err = stmt.Exec(node.Status, node.CPUUsage, node.CPUMax, node.MemoryUsage, node.MemoryLimit, node.NetworkLimit, node.NetworkUsage, node.Name) + if err != nil { + return err + } + + return nil +} + +// CreateOrUpdate creates or updates a node in the database. +// If the node already exists, it updates the existing record. +// If the node does not exist, it creates a new record. +// The function takes the node name, status, and metadata as parameters. +func (nr *NodeRepository) CreateOrUpdate(runtime string, node model.Node) error { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + existingNode, err := nr.GetByName(node.Name) + if err != nil { + return err + } + + if existingNode != nil { + // Node exists, update it + node.Name = existingNode.Name // Ensure we update the correct record + return nr.UpdateNode(node) + } + + // Node does not exist, create it + stmt, err := c.Prepare("INSERT INTO " + nr.tableName + " (name, runtime, status, cpu_usage, cpu_max, memory_usage, memory_limit, network_limit, network_usage, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'))") + if err != nil { + return err + } + defer stmt.Close() + + _, err = stmt.Exec(node.Name, node.Runtime, node.Status, node.CPUUsage, node.CPUMax, node.MemoryUsage, node.MemoryLimit, node.NetworkLimit, node.NetworkUsage) + if err != nil { + return err + } + + return nil + +} + +func (nr *NodeRepository) GetNodesByRuntime(runtime string) ([]model.Node, error) { + database := repository.Database{} + c := database.Connect() + defer c.Close() + + var nodes []model.Node + cols := model.Node{}.GetColumns() + rows, err := c.Query("SELECT "+strings.Join(cols, ", ")+" FROM "+nr.tableName+" WHERE runtime = ?", runtime) + if err != nil { + return nil, err + } + defer rows.Close() + + for rows.Next() { + var node model.Node + err = rows.Scan( + &node.Name, + &node.Runtime, + &node.Status, + &node.CPUUsage, + &node.CPUMax, + &node.MemoryUsage, + &node.MemoryLimit, + &node.NetworkLimit, + &node.NetworkUsage, + &node.CreatedAt, + &node.UpdatedAt, + ) + if err != nil { + return nil, err + } + nodes = append(nodes, node) + } + + return nodes, nil +} diff --git a/pkg/server/database/repository/schedule_repository/schedule_repository.go b/pkg/server/database/repository/schedule_repository/schedule_repository.go new file mode 100644 index 0000000..cf8f15e --- /dev/null +++ b/pkg/server/database/repository/schedule_repository/schedule_repository.go @@ -0,0 +1,155 @@ +package schedule_repository + +import ( + "github.com/ovvesley/akoflow/pkg/server/database/model" + "github.com/ovvesley/akoflow/pkg/server/database/repository" + "github.com/ovvesley/akoflow/pkg/server/entities/schedule_entity" +) + +type IScheduleRepository interface { + ListAllSchedules() ([]schedule_entity.ScheduleEntity, error) + // GetScheduleById(id int) (schedule_entity.ScheduleEntity, error) + CreateSchedule(name string, scheduleType string, code string, soFile string) (schedule_entity.ScheduleEntity, error) + GetScheduleByName(name string) (schedule_entity.ScheduleEntity, error) + // UpdateSchedule(schedule schedule_entity.ScheduleEntity) (schedule_entity.ScheduleEntity, error) + // DeleteSchedule(id int) error +} + +type ScheduleRepository struct { + tableName string +} + +var TableName = "schedules" + +func New() IScheduleRepository { + + database := repository.Database{} + c := database.Connect() + err := repository.CreateOrVerifyTable(c, model.ScheduleModel{}) + if err != nil { + return nil + } + + err = c.Close() + if err != nil { + return nil + } + + return &ScheduleRepository{ + tableName: TableName, + } +} + +func (r *ScheduleRepository) ListAllSchedules() ([]schedule_entity.ScheduleEntity, error) { + database := repository.Database{} + c := database.Connect() + + rows, err := c.Query("SELECT id, type, code, name, plugin_so_path, created_at, updated_at FROM " + r.tableName) + if err != nil { + return nil, err + } + + var schedules []schedule_entity.ScheduleEntity + for rows.Next() { + var schedule model.ScheduleModel + + var pluginSo *string // Assuming plugin_so_path is a string, adjust if it's a different type + + err = rows.Scan(&schedule.ID, &schedule.Type, &schedule.Code, &schedule.Name, &pluginSo, &schedule.CreatedAt, &schedule.UpdatedAt) + if err != nil { + return nil, err + } + + // If pluginSo is nil, set it to an empty string + if pluginSo == nil { + schedule.PluginSoPath = "" + } else { + schedule.PluginSoPath = *pluginSo + } + + schedules = append(schedules, schedule_entity.ScheduleEntity{ + ID: schedule.ID, + Type: schedule.Type, + Code: schedule.Code, + Name: schedule.Name, + PluginSoPath: schedule.PluginSoPath, // Uncomment if needed + CreatedAt: schedule.CreatedAt, // Uncomment if needed + UpdatedAt: schedule.UpdatedAt, // Uncomment if needed + }) + } + + err = c.Close() + if err != nil { + return nil, err + } + + return schedules, nil +} + +func (r *ScheduleRepository) CreateSchedule(name string, scheduleType string, code string, soFile string) (schedule_entity.ScheduleEntity, error) { + database := repository.Database{} + c := database.Connect() + + schedule := model.ScheduleModel{ + Type: scheduleType, + Code: code, + Name: name, + } + + query := "INSERT INTO " + r.tableName + " (type, code, name, plugin_so_path, created_at, updated_at) VALUES (?, ?, ?, ?, datetime('now'), datetime('now'))" + result, err := c.Exec(query, schedule.Type, schedule.Code, schedule.Name, soFile) + if err != nil { + return schedule_entity.ScheduleEntity{}, err + } + + id, err := result.LastInsertId() + if err != nil { + return schedule_entity.ScheduleEntity{}, err + } + + schedule.ID = int(id) + + err = c.Close() + if err != nil { + return schedule_entity.ScheduleEntity{}, err + } + + return schedule_entity.ScheduleEntity{ + ID: schedule.ID, + Type: schedule.Type, + Code: schedule.Code, + Name: schedule.Name, + PluginSoPath: schedule.PluginSoPath, + CreatedAt: schedule.CreatedAt, + UpdatedAt: schedule.UpdatedAt, + }, nil +} + +func (r *ScheduleRepository) GetScheduleByName(name string) (schedule_entity.ScheduleEntity, error) { + database := repository.Database{} + c := database.Connect() + + query := "SELECT id, type, code, name, plugin_so_path, created_at, updated_at name FROM " + r.tableName + " WHERE name = ?" + row := c.QueryRow(query, name) + + var schedule model.ScheduleModel + err := row.Scan(&schedule.ID, &schedule.Type, &schedule.Code, &schedule.Name, &schedule.PluginSoPath, &schedule.CreatedAt, &schedule.UpdatedAt) + if err != nil { + return schedule_entity.ScheduleEntity{}, err + } + + err = c.Close() + if err != nil { + return schedule_entity.ScheduleEntity{}, err + } + + return schedule_entity.ScheduleEntity{ + ID: schedule.ID, + Type: schedule.Type, + Code: schedule.Code, + Name: schedule.Name, + PluginSoPath: schedule.PluginSoPath, // Uncomment if needed + CreatedAt: schedule.CreatedAt, // Uncomment if needed + UpdatedAt: schedule.UpdatedAt, // Uncomment if needed + }, nil +} diff --git a/pkg/server/database/repository/workflow_execution_repository/workflow_execution_repository.go b/pkg/server/database/repository/workflow_execution_repository/workflow_execution_repository.go new file mode 100644 index 0000000..4946292 --- /dev/null +++ b/pkg/server/database/repository/workflow_execution_repository/workflow_execution_repository.go @@ -0,0 +1,57 @@ +package workflow_execution_repository + +import ( + "github.com/ovvesley/akoflow/pkg/server/database/model" + "github.com/ovvesley/akoflow/pkg/server/database/repository" +) + +type WorkflowExecutionRepository struct { + tableName string +} + +const STATUS_RUNNING = 1 +const STATUS_COMPLETED = 2 +const STATUS_FAILED = 3 +const STATUS_CANCELLED = 4 + +type IWorkflowExecutionRepository interface { + CreateOrUpdate(workflowID string, status int, metadata map[string]string) +} + +func New() IWorkflowExecutionRepository { + + database := repository.Database{} + model := model.WorkflowExecution{} + c := database.Connect() + err := repository.CreateOrVerifyTable(c, model) + if err != nil { + return nil + } + + err = c.Close() + if err != nil { + return nil + } + + return &WorkflowExecutionRepository{ + tableName: model.TableName(), + } +} + +func (wer *WorkflowExecutionRepository) CreateOrUpdate(workflowID string, status int, metadata map[string]string) { + // Implementation for creating or updating a workflow execution entry + // This would typically involve inserting or updating the record in the database + // using the provided workflowID, status, and metadata. + + // Example implementation (pseudo-code): + /* + c := repository.Database.Connect() + defer c.Close() + + query := fmt.Sprintf("INSERT INTO %s (workflow_id, status, metadata) VALUES (?, ?, ?) ON DUPLICATE KEY UPDATE status = ?, metadata = ?", wer.tableName) + _, err := c.Exec(query, workflowID, status, metadata, status, metadata) + if err != nil { + log.Error("Failed to create or update workflow execution:", err) + } + */ +} diff --git a/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler.go b/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler.go index cf6b0ab..d38554b 100755 --- a/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler.go +++ b/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler.go @@ -46,3 +46,12 @@ func (h *AkoflowAdminHandler) Runtime(w http.ResponseWriter, r *http.Request) { return } } + +func (h *AkoflowAdminHandler) Schedule(w http.ResponseWriter, r *http.Request) { + scheduleTemplate := h.renderViewProvider.TemplateInstance("schedules.tmpl.html") + err := scheduleTemplate.Execute(w, map[string]interface{}{}) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } +} diff --git a/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/base.html b/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/base.html index 6c259a1..2df6400 100644 --- a/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/base.html +++ b/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/base.html @@ -12,6 +12,8 @@ + + {{ template "script-constants" }} {{ template "connector.js" }} diff --git a/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/create_worlflow_modal.tmpl.html b/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/create_worlflow_modal.tmpl.html new file mode 100644 index 0000000..2feddc9 --- /dev/null +++ b/pkg/server/engine/httpserver/handlers/akoflow_admin_handler/akoflow_admin_handler_tmpl/common/create_worlflow_modal.tmpl.html @@ -0,0 +1,213 @@ +{{ define "create_workflow_modal" }} + + + + + + + + +
or click to select a file
+Supports .YAML and .YML
+ +