Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: create init container for job #979

Merged
merged 78 commits into from
Feb 22, 2022
Merged

Conversation

vsukhin
Copy link
Collaborator

@vsukhin vsukhin commented Feb 16, 2022

Pull request description

Create init container for volume initialization

Checklist (choose whats happened)

  • breaking change! (describe)
  • tested locally
  • tested on cluster
  • added new dependencies
  • updated the docs
  • added a test

Breaking changes

Changes

Fixes

exu and others added 11 commits February 17, 2022 12:04
… vsukhin/feature/support-job-volume

# Conflicts:
#	internal/app/api/v1/server.go
#	pkg/jobs/jobclient.go
…rt-job-volume

# Conflicts:
#	api/v1/testkube.yaml
#	cmd/api-server/main.go
#	cmd/kubectl-testkube/commands/common/validator/testsuitename.go
#	cmd/kubectl-testkube/commands/testsuites/execution.go
#	cmd/kubectl-testkube/commands/testsuites/get.go
#	docs/cli/testkube_testsuites_execution.md
#	go.mod
#	go.sum
#	internal/app/api/v1/server.go
#	pkg/jobs/jobclient.go
@vsukhin vsukhin marked this pull request as ready for review February 21, 2022 14:40
@vsukhin vsukhin changed the title feat: pass directory parameter for temp dir or file feat: create init container for job Feb 21, 2022
@cyrus-mc
Copy link

I like this feature but I think it needs to be much more generic. In that the executor POD can be customized in a number of ways.

As an example, for some of my tests I want to ensure that mutating webhook is invoked (ex: Vault secrets). Therefore I would need to add annotations and environment variables to the executor POD.

I am going to take a stab at this but it might be as simple as adding a PodSpec field to the test CRD that allows you to customize the generated Pod.

@exu
Copy link
Member

exu commented Feb 22, 2022

I like this feature but I think it needs to be much more generic. In that the executor POD can be customized in a number of ways.

As an example, for some of my tests, I want to ensure that mutating webhook are invoked (ex: Vault secrets). Therefore I would need to add annotations and environment variables to the executor POD.

I am going to take a stab at this but it might be as simple as adding a PodSpec field to the test CRD that allows you to customize the generated Pod.

Hi, @cyrus-mc thanks for your feedback. I like the idea of adding annotations very much - we could add them to:

  • executor - executor would always add those data
  • test - tests would add it owns annotations or general pod spec
  • tests-executions - test runs could also add it owns

question is if we should pass everything to a single init container or maybe create many init containers for each type (executor, test, execution)? The question also is if doing this in init containers will be enough? (Maybe some users will want to run something after tests?)

@vsukhin ^^^

@exu
Copy link
Member

exu commented Feb 22, 2022

secondly, I would extract the idea of having separate PodSpec as a separate issue as it looks like a quite big topic in terms of possible implementation complexity

@cyrus-mc
Copy link

@exu I agree about separating it out. Honestly I wasn't sure what the need for init container is as coded in this PR as the description is quite lacking.

But looking at the changes it is somewhat inline with my request about being able to fully customize the POD the tests run in. And is reason why I commented.

@vsukhin
Copy link
Collaborator Author

vsukhin commented Feb 22, 2022

Hey, @cyrus-mc. Thank you for your feedback, first of all! Yeah, I agree, that we need to provide more flexibilty in terms of running executor POD in different ways. As it usually happens, we're evolving from simple implementation to more complex and powerful solutions. For sure, you might end up having multiple init containers or none, adding annotations, env vars, etc. The idea behind this pr was to support creation of executor in different programming languages by prefetching test data to pod volume by init container and allow executor container to decide what to do with prefetched data. This is a fisrt step ;)

@exu
Copy link
Member

exu commented Feb 22, 2022

@cyrus-mc we've extracted your suggestions as separate issue here #1008
We'll get into it for 0.11 release (currently we are on the end of 0.10 which should be ok for next week) so we'll get back to it as quick as possible

@vsukhin vsukhin merged commit 3d8939d into main Feb 22, 2022
@vsukhin vsukhin deleted the vsukhin/feature/support-job-volume branch February 22, 2022 12:37
exu added a commit that referenced this pull request Feb 23, 2022
* ref: rename test - test-suite in opanapi spec nad model part1

* rename _test to _test_suite

* fix: generated testsuite from openapispec

* chore: rename TestKube to Testkube

* rename _script to _test

* rename _script to _test part2

* testName to testSuiteName and scriptName to testName

* api client refactor

* chore: rename testsuite to test and scripts to tests - commands

* script to test refactor

* mappers renaming

* scripts

* more rename

* more scripts renaming

* feat: bump operator version

* fix: using new operator clients and apis

* docs update

* fixed tests

* renamed proxy client in tests

* docs - generated from cobra commandfs

* fix: integration tests

* fix: more scripts to tests renaming

* fix: more scripts to tests renaming

* fix: docs with testsuites

* fix: renaming

* fix: renaming

* fix: renaming in postman tests

* feat: new testkube logos

* feat: new squishies image

* fix: nil pointer panic

* fix: kubectl plugin test suite fix

* feat: pass directory parameter for temp dir ror file

* fix: update unit test

* feat: create data volume for job

* feat: pass init image to job

* fix: fix unit test

* fix: fixed sanity suite

* Update cmd/kubectl-testkube/commands/tests/update.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/create.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/delete.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/deleteall.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/delete.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/deleteall.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/delete.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* fix: renamed test suites commands

* Update cmd/kubectl-testkube/commands/testsuites/executions.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/executions.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/get.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/get.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/executions.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/tests-creating.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/tests-creating.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/cli/testkube_testsuites_create.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/list.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/list.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/update.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/cli/testkube_testsuites_watch.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/list.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/run.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/cli/testkube_testsuites_watch.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers + get back to namespace

* fix: return init image uri

* fix: locate init image by name

Co-authored-by: Jacek Wysocki <jacek.wysocki@gmail.com>
Co-authored-by: Vladislav Sukhin <vladislav@kubeshop.io>
Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>
exu added a commit that referenced this pull request Feb 28, 2022
* docs: update executor docs

* docs: cli docs generated

* docs: executor

* docs: executor docs update

* docs: executors elaborated on content data types

* feat: create init container for job (#979)

* ref: rename test - test-suite in opanapi spec nad model part1

* rename _test to _test_suite

* fix: generated testsuite from openapispec

* chore: rename TestKube to Testkube

* rename _script to _test

* rename _script to _test part2

* testName to testSuiteName and scriptName to testName

* api client refactor

* chore: rename testsuite to test and scripts to tests - commands

* script to test refactor

* mappers renaming

* scripts

* more rename

* more scripts renaming

* feat: bump operator version

* fix: using new operator clients and apis

* docs update

* fixed tests

* renamed proxy client in tests

* docs - generated from cobra commandfs

* fix: integration tests

* fix: more scripts to tests renaming

* fix: more scripts to tests renaming

* fix: docs with testsuites

* fix: renaming

* fix: renaming

* fix: renaming in postman tests

* feat: new testkube logos

* feat: new squishies image

* fix: nil pointer panic

* fix: kubectl plugin test suite fix

* feat: pass directory parameter for temp dir ror file

* fix: update unit test

* feat: create data volume for job

* feat: pass init image to job

* fix: fix unit test

* fix: fixed sanity suite

* Update cmd/kubectl-testkube/commands/tests/update.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/create.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/delete.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/deleteall.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/common.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/delete.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/deleteall.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/delete.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* fix: renamed test suites commands

* Update cmd/kubectl-testkube/commands/testsuites/executions.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/executions.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/get.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/get.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/executions.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/tests-creating.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/tests-creating.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/cli/testkube_testsuites_create.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/list.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/list.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/update.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/cli/testkube_testsuites_watch.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/list.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update cmd/kubectl-testkube/commands/testsuites/run.go

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* Update docs/cli/testkube_testsuites_watch.md

Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers

* fix: more rename leftovers + get back to namespace

* fix: return init image uri

* fix: locate init image by name

Co-authored-by: Jacek Wysocki <jacek.wysocki@gmail.com>
Co-authored-by: Vladislav Sukhin <vladislav@kubeshop.io>
Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>

* docs: cli docs generated (#1014)

* fix: reformat

* fix: reorder sentences and removed dups

* docs: added custom executor in nodejs docs

* added Jamie as docs owner

* fix: docs grammar from Julianne

Co-authored-by: Vladislav Sukhin <vsukhin@virtuososoft.com>
Co-authored-by: Vladislav Sukhin <vladislav@kubeshop.io>
Co-authored-by: nicufk <89570185+nicufk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants