Commit Graph

35 Commits

Author SHA1 Message Date
Nikola Jokic
96c35e7cc6 Remove dependency on the runner's volume (#244)
* bump actions

* experiment using init container to prepare working environment

* rm script before continuing

* fix

* Update packages/k8s/src/hooks/run-script-step.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* leverage exec stat instead of printf

* npm update

* document the new constraint

---------

Co-authored-by: DenisPalnitsky <DenisPalnitsky@users.noreply.github.com>
2025-10-02 16:23:07 +02:00
Nikola Jokic
589414ea69 Bump all dependencies (#234)
* Bump all dependencies

* build and reformat

* lint

* format
2025-07-29 11:06:45 +02:00
Nikola Jokic
375992cd31 Expose CI=true and GITHUB_ACTIONS env variables (#215)
* Expose CI=true and GITHUB_ACTIONS env variables

* fmt

* revert the prettier and finish this

* revert package-lock.json
2025-04-17 12:08:32 +02:00
Nikola Jokic
aae800a69b bump node in tests to node 22 since node14 is quite old (#216)
* bump node in tests to node 22 since node14 is quite old

* change test contsants
2025-04-16 15:57:59 +02:00
Nikola Jokic
ca4ea17d58 Skip writing extension containers in output context file (#154) 2024-06-19 11:49:43 +02:00
Katarzyna
99efdeca99 Mount /github/workflow to docker action pods (#137)
* Mount /github/workflow to docker action pods, the same way as for container job pods

* Adjust tests
2024-03-14 12:36:27 +01:00
Katarzyna
7223e1dbb2 Use ACTIONS_RUNNER_CONTAINER_HOOK_TEMPLATE to extend service containers (#134)
https://github.com/actions/runner-container-hooks/issues/132

Co-authored-by: Katarzyna Radkowska <katarzyna.radkowska@sabre.com>
2024-02-20 16:19:29 +01:00
Nikola Jokic
921be5b85f Fix is alpine check using shlex (#130) 2024-02-05 09:50:51 +01:00
Nikola Jokic
c093f87779 Docker and K8s: Fix shell arguments when split by the runner (#115)
* Docker: Fix shell arguments when split by the runner

* Add shlex to k8s hook as well
2023-11-20 15:09:36 +01:00
Wout Van De Wiel
90a6236466 Add option to use the kubernetes scheduler for workflow pods (#111)
* Add option to use kube scheduler

This should only be used when rwx volumes are supported or when using a single node cluster.

* Add option to set timeout for prepare job

If the kube scheduler is used to hold jobs until sufficient resources are available,
then prepare job needs to wait for a longer period until the workflow pod is running.
This timeout will mostly need an increase in cases where many jobs are triggered
which together exceed the resources available in the cluster.
The workflows can then be gracefully handled later when sufficient resources become available again.

* Skip name override warning when names match or job extension

* Add guard for positive timeouts with a warning

* Write out ReadWriteMany in full
2023-10-31 12:51:09 +01:00
Nikola Jokic
4cdcf09c43 Implement yaml extensions overwriting the default pod/container spec (#75)
* Implement yaml extensions overwriting the default pod/container spec

* format files

* Extend specs for container job and include docker and k8s tests in k8s

* Create table tests for docker tests

* included warnings and extracted append logic as generic

* updated merge to allow for file read

* reverted back examples and k8s/tests

* reverted back docker tests

* Tests for extension prepare-job

* Fix lint and format and merge error

* Added basic test for container step

* revert hooklib since new definition for container options is received from a file

* revert docker options since create options are a string

* Fix revert

* Update package locks and deps

* included example of extension.yaml. Added side-car container that was missing

* Ignore spec modification for the service containers, change selector to

* fix lint error

* Add missing image override

* Add comment explaining merge object meta with job and pod

* fix test
2023-09-25 11:49:03 +02:00
Nikola Jokic
8b83223a2b Add limitation and throw if an entrypoint is not specified for container step (#77) 2023-07-17 11:02:03 +02:00
Arthur Baars
c37c5ca584 k8s: handle $ symbols in environment variable names and values (#74)
* Add test cases

* Handle $ symbols in environment variable names and values
2023-04-18 15:14:10 +02:00
Nikola Jokic
4448b61e00 Fix service port mappings when input is undefined, null, or empty (#60)
* fix: service without ports defined

* fix port mappings when ports are undefined,null or empty

* fix

Co-authored-by: Ronald Claveau <ronald.claveau@pennylane.com>
2023-01-06 11:54:52 +01:00
Niels ten Boom
73914b840c fix: naming for services & service entrypoint (#53)
* rename to container

* fix container image name bug

* fix entrypoint bug

* bump patch version

* formatting

* fix versions in package-lock

* add test

* revert version bump

* added check + test for args as well

* formatting

* remove cscode launch.json

* expand example json

* wrong version, revert to correct one

* correct lock

* throw error on invalid image definition

* change falsy check

* Update packages/k8s/src/k8s/utils.ts

Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>

Co-authored-by: Ferenc Hammerl <31069338+fhammerl@users.noreply.github.com>
2023-01-06 10:22:41 +01:00
Nikola Jokic
d988d965c5 fixing issue related to setting hostPort and containerPort when format is port/proto (#38)
* fixing issue related to setting hostPort and containerPort when format is port/proto

* added one more test case and refactored containerPorts to be without regexp

* added throw on ports outside of (0,65536) range with test

* repaired error message and added tests to multi splits. refactored port checking
2022-11-15 14:23:09 +01:00
Nikola Jokic
23cc6dda6f fixed substring issue with /github/workspace and /github/file_commands (#35)
* fixed substring issue with /github/workspace and /github/file_commands

* npm run format

* last 3 parts of the path are mounted to /github/workspace and /github/file_commands

* file commands now point to _temp/_runner_file_commands
2022-11-03 14:55:07 +01:00
Nikola Jokic
eb47baaf5e Adding more tests and minor changes in code (#21)
* added cleanup job checks, started testing constants file

* added getVolumeClaimName test

* added write entrypoint tests

* added tests around k8s utils

* fixed new regexp

* added tests around runner instance label

* 100% test coverage of constants
2022-06-22 14:15:42 -04:00
Nikola Jokic
20c19dae27 refactor around job claim name and runner instance labels (#20)
* refactor around job claim name, and runner instance labels

* repaired failing test
2022-06-22 09:32:50 -04:00
Thomas Boop
4307828719 Don't use JSON.stringify for errors (#19)
* better error handling

* remove unneeded catch

* Update index.ts
2022-06-22 15:20:48 +02:00
Thomas Boop
bb1a033ed7 Make K8s claim name optional (#18)
* make claim name optional

* update version and notes

* fix ci

* correctly invoke function
2022-06-20 15:09:04 -04:00
Nikola Jokic
898063bddd repaired docker PATH export and added tests both for docker and k8s (#17)
* repaired docker PATH export and added tests both for docker and k8s

* added todo comments about next major version and typeof prepend path
2022-06-16 09:44:40 -04:00
Nikola Jokic
8ea57170d8 Fix working directory and write state for appPod to be used in run-script-step (#8)
* added initial entrypoint script

* change workingg directory working with addition to fix prepare-job state output

* added prepend path

* added run-script-step file generation, removed prepend path from container-step and prepare job

* latest changes with testing run script step

* fix the mounts real fast

* cleanup

* fix tests

* add kind test

* add kind yaml to ignore and run it during ci

* fix kind option

* remove gitignore

* lowercase pwd

* checkout first!

* ignore test file in build.yaml

* fixed wrong working directory and added test to run script step testing for the env

* handle env's/escaping better

* added single quote escape to env escapes

* surounded env value with single quote

* added spacing around run-container-step, changed examples to actually echo hello world

* refactored tests

* make sure to escape properly

* set addition mounts for container steps

* fixup container action mounts

Co-authored-by: Thomas Boop <thboop@github.com>
Co-authored-by: Thomas Boop <52323235+thboop@users.noreply.github.com>
2022-06-14 21:41:49 -04:00
Nikola Jokic
d3ec1c0040 prepare job in k8s does not allow for no job container 2022-06-10 16:38:07 +02:00
Nikola Jokic
7ae8942b3d Repaired prepare-job hook without job container 2022-06-10 11:07:50 +02:00
Thomas Boop
5daaae120b Merge pull request #9 from actions/nikola-jokic/user-volume-mounts-path
User volume mount restriction to the work directory mounts if path is absolute
2022-06-08 11:15:31 -04:00
Nikola Jokic
88b7b19db7 fixed interface for hooklib and example repos 2022-06-08 13:25:45 +02:00
Nikola Jokic
84a57de2e3 added tests around user volume mounts for prepare job 2022-06-08 11:23:05 +02:00
Nikola Jokic
02f0b322a0 fixed merge conflict, repaired paths in examples 2022-06-08 11:02:33 +02:00
Thomas Boop
e928fa3252 Pass secrets more securely for container action 2022-06-06 18:43:57 -04:00
Thomas Boop
689a74e352 run format 2022-06-06 14:27:06 -04:00
Thomas Boop
55c9198ada new pv for each pod 2022-06-06 14:15:14 -04:00
Nikola Jokic
0ebccbd8c6 fixed testing adding storage class and persistent volume and timeout to wait for cleanup 2022-06-06 12:56:50 +02:00
Thomas Boop
ec8131abb7 setup ci to run k8s tests 2022-06-06 00:21:44 -04:00
Thomas Boop
6159767f90 Initial Commit 2022-06-02 15:53:11 -04:00