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

Terraform task #375

Open
kuebler opened this issue Jan 7, 2022 · 12 comments
Open

Terraform task #375

kuebler opened this issue Jan 7, 2022 · 12 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@kuebler
Copy link
Collaborator

kuebler commented Jan 7, 2022

I was wondering recently if we need a Tekton task to support provisioning e.g. AWS services via IaC based on terraform, similar to https://github.com/opendevstack/ods-quickstarters/blob/master/common/jenkins-agents/terraform/docker/Dockerfile.ubi8? IMO, automated e2e testing might be an interesting challenge, probably https://localstack.cloud/ could help? Would be really grateful for any feedback on this idea!

@kuebler kuebler added enhancement New feature or request question Further information is requested labels Jan 7, 2022
@michaelsauter
Copy link
Member

  • Yes we need a task for that!
  • I think we could avoid testing within GitHub Actions. The tech used in referenced quickstarter has its own tests as far as I understand, so I think it would be good enough if we verify the glue works.

@gerardcl
Copy link
Member

gerardcl commented Jan 7, 2022

hi! yes, agree, we should also get a task from ods-pipeline for this. Since I also was thinking on this I offer myself to play with it or together or whatever you prefer :)
Currently there is an activity ongoing on ods-jenkins-shared-library to make the AWS quickstarter more lean from a quickstarter point of view and that gave us a good understanding also on moving to ods-pipeline I believe :)
Great!

@tbugfinder
Copy link

tbugfinder commented Jan 11, 2022

IMHO, localstack community edition doesn't offer too many options (AWS services) to work with.
Are you talking about PRO/Enterprise version?

@gerardcl
Copy link
Member

IMHO we could just follow current approach in ods-quickstarters, what do you think @tbugfinder @kuebler ?

@nichtraunzer
Copy link
Member

e2e tests for AWS are quite a while on our whish list already and I like the idea a lot

@gerardcl
Copy link
Member

ok, I thought they were already in with current quickstarter smoke/deployment tests, sorry

@nichtraunzer
Copy link
Member

ok ... after a quick discussion with mr. @tbugfinder I am little bit confused now:

  • what we are looking for is a e2e test from the developer perspective - means when we do changes in a cloud QS we still have to do deployment tests manually (start an ODS in a Box, provision the QS and deploy the imbedded code to AWS/AZURE) to verify the submitted code ...
  • @gerardcl .... u r right ... from the QS consumer perspective the tests are part of the QS already

@michaelsauter
Copy link
Member

OK, then I would suggest to implement a test that doesn't run with the default test suite. Have a look at https://github.com/opendevstack/ods-pipeline/blob/master/test/tasks/ods-deploy-helm_external_test.go. This implements a test that you can run locally against a cluster of your choice. You could mirror this by having a test that you can execute on demand that runs against an AWS account of your choice.

@gerardcl
Copy link
Member

Great! Then we would have both E2E use cases covered (ods developer E2E to be done, and app developer tests plus smoke tests in place).
What needs to be tested in the ods dev E2E tests? I guess we would need to test with a mock IaaS?

@gerardcl
Copy link
Member

Based on the description made by @kuebler in the github issue, here an agreed TODOs after meeting (@tbugfinder @nichtraunzer @michaelsauter @kuebler me):

  • Task image: to create a task’s image with the already required tools (e.g.: terraform CLI,…) similar to the existing terraform Jenkins agent (see ods-pipeline example of an existing image for go here).

    • NOTE: we need to enable both ARM anc x86_64 architectures!
  • Task script: to map the process already in use by the AWS QS for example (see current Jenkinsfile approach here, and an ods-pipeline example for the go task script here)

  • Testing: in phases we should implement the following

    1. To have an ignored test (not runnable in github) that tests the task itself and only run it locally when providing the right flags for required params (e.g.: AWS credentials, etc...) -> see here how we do it already for testing helm deploying to an external cluster - deploy to external cluster example
    2. Test workspace: to reuse the current AWS QS files as baseline for the task’s tests. See example of a workspace for helm example.
    3. Next steps can be to integrate within github actions a connection to a testing AWS account (and make this task test non-optional for github actions)

@tbugfinder
Copy link

As localstack was mentioned - there's also python based moto https://github.com/spulec/moto .

@kuebler
Copy link
Collaborator Author

kuebler commented Aug 15, 2022

@tbugfinder looks fantastic and seems to support way more AWS services OOTB than the localstack OSS variant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants