In run-script-step, the _temp directory was being copied to the workflow pod,
but the _github_home and _github_workflow directories were not being moved
from their temporary location to the /github directory structure where they
are expected by GitHub Actions.
This caused event.json to be missing at /github/workflow/event.json, breaking
actions that depend on GITHUB_EVENT_PATH.
The fix adds a setup step that copies _github_home and _github_workflow from
/__w/_temp/ to /github/ after copying the temp directory to the pod, matching
the behavior of run-container-step and prepareJobScript.
Uses cp -r instead of symlinks to avoid symlink validation errors when copying
files back from the pod to the runner.
* fix: calculate hash again after failure
The hash from the source is calculated only once. The source hash is
checked with the destination hash, but if the destination hash does not
match, the destination match is calculated again.
The problem is that if the source hash is incorrect, the check will keep
failing because the source hash is never re-calculated.
Now, in the event that the hashes do not match, the hash of the source
and the destination are calculated again.
* fix: use size instead of block size
Previously the %b parameter was used with stat. This displays the block
size of the file. We noticed that in some cases the block size of the
source and the destination file could be slightly different. Since the
source and target run in different containers, they can have different
block sizes defined. If the block size did not match, the hash would also not match, even if
the file content would be exactly the same.
With this change, the block size is no longer used. Instead the actual
size in bytes of the file is listed.
* feat: check if required binaries are present
Previously the necessary binaries were copied over using the runner
container. This lead to issues in case your main container was using the
musl libc implementation.
Instead of copying over any binaries, the initContainer now checks if
the required binaries are present in the main container.
* feat: get rid of the init container
* fix: add _runner_file_commands
* fix: do not fail if _runner_file_commands does not exist
It seems that for container actions this directory does not exist.
* 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
* 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
* Ensure responseconsist no matter having ports or not.
* Update packages/k8s/src/hooks/prepare-job.ts
Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com>
---------
Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com>
There might be situation where reading from standard input fails. In
that case, we should encapsulate that exception within the try catch
block to avoid unhandeled Promise rejection exception and provide more
information about the error
* 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>
* 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
* 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
* 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>