Skip to content

Comments

feat: add tanka integration to Devspace#2344

Closed
xvzf wants to merge 25 commits intodevspace-sh:mainfrom
ankorstore:feat/add-tanka-integration
Closed

feat: add tanka integration to Devspace#2344
xvzf wants to merge 25 commits intodevspace-sh:mainfrom
ankorstore:feat/add-tanka-integration

Conversation

@xvzf
Copy link
Contributor

@xvzf xvzf commented Sep 26, 2022

/kind feature
resolves #2269

Purpose

This PR picks up on #2325 and introduces Tanka environment support for Devspaces. We internally use Tanka and would like to share a common code base between all environments, including local development stacks.

Todos

  • Extend the schema definition with a tanka deployment configuration
  • Fix the schema of deployments.tanka
  • Add a Tanka deployer under pkg/devspace/deploy/deployer/tanka
  • Check if we add an option to run jb update before using tk
  • Make a PR to https://github.com/loft-sh/loft-util to be able to download tanka binary
  • Add e2e tests

Closes #2325

@xvzf xvzf marked this pull request as draft September 26, 2022 10:47
@xvzf xvzf force-pushed the feat/add-tanka-integration branch from 3cfd7c9 to 7b0613b Compare September 26, 2022 11:25
@alexandradragodan
Copy link
Contributor

Hello, @alexissellier , @xvzf !

Thanks a lot for your contribution so far, we're really appreciating it.
I was wondering if you are still working on this specific feature or planning to further contribute to it in the future.

If there's anything we can support with, please don't hesitate to ask.
Thanks

@xvzf
Copy link
Contributor Author

xvzf commented Oct 25, 2022

Hi @alexandradragodan,

yes, we're still on this; the work has been paused for a few weeks due to a shift in priorities I/we plan to get this out rather soon as we have to get it out shortly.

I think we are good for now, still need to find the time to develop the proper testing!

Best,
Matthias

@xvzf xvzf force-pushed the feat/add-tanka-integration branch 4 times, most recently from 8d09deb to 89dd145 Compare October 28, 2022 14:28
@xvzf
Copy link
Contributor Author

xvzf commented Oct 28, 2022

@alexandradragodan is there any reason to use go mod vendor?

We had to update some of the dependencies as the build has been failing, and it resulted in a very huge commit: 8724be3

@xvzf xvzf force-pushed the feat/add-tanka-integration branch 5 times, most recently from 84e54f9 to b438440 Compare November 7, 2022 11:13
@FabianKramm
Copy link
Collaborator

@xvzf we commit the dependencies to make sure everything that is needed to run the project is checked into github which includes the vendor folder. What dependencies did you need to update?

@xvzf
Copy link
Contributor Author

xvzf commented Nov 7, 2022

@FabianKramm I just rebased on the main branch and cleaned up some of our commits; this fixes the issue. Should be ready to review now!

@xvzf xvzf marked this pull request as ready for review November 7, 2022 11:24
@xvzf xvzf changed the title [WIP] feat: add tanka integration to Devspace feat: add tanka integration to Devspace Nov 7, 2022
@xvzf xvzf force-pushed the feat/add-tanka-integration branch from ef365ce to 815c4b0 Compare November 15, 2022 11:08
@xvzf
Copy link
Contributor Author

xvzf commented Nov 15, 2022

@FabianKramm I rebased again on main - not sure why the checks were failing. It works fine for me on MacOS & inside a plain docker container now, so likely resolved.

In addition, I'm installing the tanka binary in the e2e test dependencies

@FabianKramm
Copy link
Collaborator

@xvzf this is the error we see in the checks (https://github.com/loft-sh/devspace/actions/runs/3469882468/jobs/5800565983):

ok  	github.com/loft-sh/devspace/pkg/devspace/deploy/deployer/kubectl/walk	1.054s	coverage: 73.3% of statements
--- FAIL: TestNewTankaEnvironment (0.00s)
    --- FAIL: TestNewTankaEnvironment/HydrateArguments (0.00s)
panic: cannot handle unexported field at {*tanka.tankaEnvironmentImpl}.stdout.(*os.File).file:
	"os".File
consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported [recovered]
	panic: cannot handle unexported field at {*tanka.tankaEnvironmentImpl}.stdout.(*os.File).file:
	"os".File
consider using a custom Comparer; if you control the implementation of type, you can also consider using an Exporter, AllowUnexported, or cmpopts.IgnoreUnexported

goroutine 7 [running]:
testing.tRunner.func1.2({0x20e7720, 0xc0000cdea0})
	C:/hostedtoolcache/windows/go/1.19.3/x64/src/testing/testing.go:1396 +0x372
testing.tRunner.func1()
	C:/hostedtoolcache/windows/go/1.19.3/x64/src/testing/testing.go:1399 +0x5f0
panic({0x20e7720, 0xc0000cdea0})
	C:/hostedtoolcache/windows/go/1.19.3/x64/src/runtime/panic.go:890 +0x262
github.com/google/go-cmp/cmp.validator.apply({{}}, 0xc000185ae0, {0x21b9960?, 0xc0000c6008?, 0x2732730?}, {0x21b9960?, 0xc0000c6008?, 0x21b9960?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/options.go:244 +0x445
github.com/google/go-cmp/cmp.(*state).tryOptions(0xc000185ae0, {0x274d4c8, 0x21b9960}, {0x21b9960?, 0xc0000c6008?, 0x4aee39?}, {0x21b9960?, 0xc0000c6008?, 0x4b0405?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:304 +0x146
github.com/google/go-cmp/cmp.(*state).compareAny(0xc000185ae0, {0x273e618, 0xc000022d00?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:259 +0x5a9
github.com/google/go-cmp/cmp.(*state).compareStruct(0xc000185ae0, {0x274d4c8, 0x2230fe0}, {0x2230fe0?, 0xc0000c6008?, 0xc0002fec40?}, {0x2230fe0?, 0xc0000c6008?, 0x199?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:412 +0xa52
github.com/google/go-cmp/cmp.(*state).compareAny(0xc000185ae0, {0x273e588, 0xc0000d1e40?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:287 +0x1412
github.com/google/go-cmp/cmp.(*state).comparePtr(0xc000185ae0, {0x274d4c8, 0x236f500}, {0x236f500?, 0xc0000c6008?, 0x0?}, {0x236f500?, 0xc0000c6008?, 0x21c2c[98](https://github.com/loft-sh/devspace/actions/runs/3469882468/jobs/5800565983#step:4:99)?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:564 +0x785
github.com/google/go-cmp/cmp.(*state).compareAny(0xc000185ae0, {0x273e678, 0xc0000d1e00?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:293 +0x1252
github.com/google/go-cmp/cmp.(*state).compareInterface(0x21c2c60?, {0x274d4c8?, 0x21c2c60?}, {0x21c2c60?, 0xc000185980?, 0xc0000267b0?}, {0x21c2c60?, 0xc0001858e0?, 0x4611c5?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:577 +0x6df
github.com/google/go-cmp/cmp.(*state).compareAny(0xc000185ae0, {0x273e618, 0xc000022c00?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:295 +0x11ac
github.com/google/go-cmp/cmp.(*state).compareStruct(0xc000185ae0, {0x274d4c8, 0x22e4f40}, {0x22e4f40?, 0xc000185900?, 0xc00017e820?}, {0x22e4f40?, 0xc000185860?, 0x437bf41?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:412 +0xa52
github.com/google/go-cmp/cmp.(*state).compareAny(0xc000185ae0, {0x273e588, 0xc0000d1d80?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:287 +0x1412
github.com/google/go-cmp/cmp.(*state).comparePtr(0xc000185ae0, {0x274d4c8, 0x2269d60}, {0x2269d60?, 0xc000185900?, 0x[100](https://github.com/loft-sh/devspace/actions/runs/3469882468/jobs/5800565983#step:4:101)0000000000?}, {0x2269d60?, 0xc000185860?, 0x20?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:564 +0x785
github.com/google/go-cmp/cmp.(*state).compareAny(0xc000185ae0, {0x2733368, 0xc0000d1d40?})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:293 +0x1252
github.com/google/go-cmp/cmp.Diff({0x2269d60, 0xc000185900}, {0x2269d60, 0xc000185860}, {0xc0000cddf0, 0x1, 0x1})
	D:/a/devspace/devspace/vendor/github.com/google/go-cmp/cmp/compare.go:[120](https://github.com/loft-sh/devspace/actions/runs/3469882468/jobs/5800565983#step:4:121) +0xd5
github.com/loft-sh/devspace/pkg/devspace/deploy/deployer/tanka.TestNewTankaEnvironment.func1(0xc00017e340)
	D:/a/devspace/devspace/pkg/devspace/deploy/deployer/tanka/builder_test.go:73 +0x267
testing.tRunner(0xc00017e340, 0xc0000cdcf0)
	C:/hostedtoolcache/windows/go/1.19.3/x64/src/testing/testing.go:[144](https://github.com/loft-sh/devspace/actions/runs/3469882468/jobs/5800565983#step:4:145)6 +0x217
created by testing.(*T).Run
	C:/hostedtoolcache/windows/go/1.19.3/x64/src/testing/testing.go:1493 +0x75e
FAIL	github.com/loft-sh/devspace/pkg/devspace/deploy/deployer/tanka	0.186s
FAIL
?   	github.com/loft-sh/devspace/pkg/devspace/deploy/testing	[no test files]

@xvzf
Copy link
Contributor Author

xvzf commented Nov 16, 2022

@FabianKramm yeah, noticed as well. We don't have windows internally - I'll try to find a fix for this

@alexissellier alexissellier force-pushed the feat/add-tanka-integration branch from 3edf0d8 to 110d8d3 Compare November 21, 2022 17:38
@alexissellier
Copy link
Contributor

@FabianKramm I've change the test so we do not need to rely on cmp.AllowUnexported, thus no more discrepancy between windows and linux regarding the tests

@xvzf xvzf force-pushed the feat/add-tanka-integration branch from 110d8d3 to 3474f41 Compare November 22, 2022 20:24
@xvzf
Copy link
Contributor Author

xvzf commented Nov 22, 2022

@FabianKramm can you give it another spin please? Hopefully the final one!

@xvzf
Copy link
Contributor Author

xvzf commented Nov 23, 2022

We're looking into it. It seems more and more to be a flaky test :)

@xvzf
Copy link
Contributor Author

xvzf commented Nov 23, 2022

So, flag order is now deterministic and test cases should pass consistently now. Sorry for the inconvenience!

Ping to @carlmontanari to re-trigger the test cases :)

xvzf and others added 23 commits March 20, 2023 11:17
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Co-authored-by: Alexis Sellier <alexis.sellier@ankorstore.com>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Author:    Alexis Sellier <alexis.sellier@ankorstore.com>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Author:    Alexis Sellier <alexis.sellier@ankorstore.com>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
helm is included by default thus it did not throw any errors

Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Author:    Alexis Sellier <alexis.sellier@ankorstore.com>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
…efault

Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Co-authored-by: Jordi Clariana <657626+jordiclariana@users.noreply.github.com>
Signed-off-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
* Add runtime vars substitution for Tanka arguments

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

* Update pkg/devspace/deploy/deployer/tanka/builder.go

Co-authored-by: Matthias Riegler <me@xvzf.tech>

* Update builder.go

---------

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
Co-authored-by: Matthias Riegler <me@xvzf.tech>
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
* Fix tests
* Fix E2E tests
* buildArgs function refactor

---------

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
@jordiclariana jordiclariana force-pushed the feat/add-tanka-integration branch 2 times, most recently from a50e691 to e4f0a71 Compare March 20, 2023 11:09
* Make `tanka.Path` optional

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

* Update Path and environmentPath docs

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

* Update tanka.path and tanka.environmentPath inline code documentation

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

* Fix lint errors

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

---------

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
* Fix tests (#7)

* Fix tests
* Fix E2E tests
* buildArgs function refactor

---------

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

* More docs updates

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>

---------

Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
@jordiclariana jordiclariana force-pushed the feat/add-tanka-integration branch from e4f0a71 to 8ca50b2 Compare March 20, 2023 11:11
@deniseschannon
Copy link

Unfortunately, we are not going to include tanka integration into our core codebase for now. Thanks for working on it!

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.

Add tanka as a new way to deploy services

7 participants