Commit Graph

58 Commits

Author SHA1 Message Date
Eng Zer Jun 9085531583
refactor: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16 [1]. This commit
replaces the existing io/ioutil functions with their new definitions in
io and os packages.

[1]: https://golang.org/doc/go1.16#ioutil

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-06-18 16:54:49 +08:00
Rui Yang a83babf79d switch to ifirit fake runner v2; couple lager/v3 correction
Signed-off-by: Rui Yang <ruiya@vmware.com>
2023-04-27 22:28:45 -04:00
Rui Yang 1f08051fa2 regenerate fakes. switch to go-jose/go-jose. swtich to ifirit ginkgomon_v2
Signed-off-by: Rui Yang <ruiya@vmware.com>
2023-04-27 14:51:03 -04:00
Rui Yang e791b0ee70 Revert "revert lager/v3 import path to lager"
This reverts commit 2128a10189.

Since upstream lager also revert their change of v3

Signed-off-by: Rui Yang <ruiya@vmware.com>
2023-04-27 14:50:56 -04:00
Rui Yang 2128a10189 revert lager/v3 import path to lager
Signed-off-by: Rui Yang <ruiya@vmware.com>
2023-04-27 10:38:10 -04:00
Rui Yang a648877a71 bump lager to v3
when bumping ginkgo to v2, a third party lib of ginkgo has to be
included in go.mod to fix a ginkgo flag redefined error. The root
cause is a test file imports ginkgo v2 and a lib who imports ginkgo
v1.

So now we need to bump lager to v3 who also uses ginkgo v2, together
with concourse/retryhttp and concourse/flag bumps to get rid of the
ginkgo v1 reference everywhere.

Signed-off-by: Rui Yang <ruiya@vmware.com>
2023-04-27 10:38:04 -04:00
Rui Yang a97b4bac23 continue update test syntax for ginkgo v2
- remove ginkgo v1 reference
 - remove deprecated ginkgo table import
 - replace GinkgoParallelNode with GinkgoParallelProcess
 - bump ginkgo v2 to latest v2.9
 - fix an error "flag redefined ginkgo.seed". See more in https://github.com/onsi/ginkgo/issues/875#issuecomment-1036350659

Signed-off-by: Rui Yang <ruiya@vmware.com>
2023-03-11 00:11:23 -05:00
David Timm 20c3b18735 test: update references to use ginkgo/v2
Ginkgo 2.0 introduced [new features](https://onsi.github.io/ginkgo/MIGRATING_TO_V2#major-additions-and-improvement)
that substatially improve developer experience. It is also now the only
actively developed and supported version of Ginkgo.

Co-authored-by: Rui Yang <ruiya@vmware.com>
Signed-off-by: David Timm <dtimm@vmware.com>
2023-03-10 17:33:13 -05:00
Aidan Oldershaw 3fb504a65d bump dex to 0.4.0
remove pkger and use go embed for dex web assets

not sure why it insists on bumping containerd and friends as well

Signed-off-by: Rui Yang <ryang@pivotal.io>
Co-authored-by: Aidan Oldershaw <aoldershaw@pivotal.io>

Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
2021-03-19 16:01:32 -04:00
Aidan Oldershaw 31bf677cee S: extract common Ginkgo setup
several test suites had to do the same setup/teardown for the postgres
process. this commit adds a helper to configure the Before/AfterSuite
for the common case, while adding more fine-grained helpers if you e.g.
need a more complicated Before/AfterSuite (since Ginkgo only lets you
have one)

Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
2021-02-04 17:56:13 -05:00
Aidan Oldershaw 5aeb741607 optimize other suites using postgresrunner
rather than the awkward "RestoreDBFromTemplate" method, we can instead
create the DB from a template at the start of each test and then drop it
after each test.

some of these suites, due to their nature (testing migrations
themselves) or Ginkgo awkwardness (can't have both BeforeSuite and
SynchronizedBeforeSuite), require creating a fresh database each time -
for this, there's CreateEmptyTestDB. typically, CreateTestDBFromTemplate
is what you'll want, though

Signed-off-by: Aidan Oldershaw <aoldershaw@pivotal.io>
2021-02-01 10:20:31 -05:00
Alex Suraci 808039bbd9 move pkged.go to cmd/concourse/
Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
Co-authored-by: Rui Yang <ruiya@vmware.com>
2021-01-28 14:42:35 -05:00
Rui Yang 94116be72b commit pkger generated assets file
pkged.go contains assets file for Dex under skymarshal/web, which
will be accessed by Dex server during runtime.

Signed-off-by: Rui Yang <ruiya@vmware.com>
2020-10-27 12:25:46 -04:00
Rui Yang e733e8f8aa skymarshal: dex: bump dex module to v0.2.0
so it could get latest from upstream dex and the release of
concourse/dex in the future could be picked up by dependabot

Signed-off-by: Rui Yang <ruiya@vmware.com>
2020-10-26 16:41:08 -04:00
Jamie Klassen 04a723480d increase timeout for system claim startup error
I've noticed this test flaking for a while now, and it's integrating across a
wide boundary -- I think it's OK to simply make it a bit more permissive.

On the other hand, it's a very small piece of validation logic that is being
tested, which would be a natural candidate for a unit test. We may have a bit
of a separation problem here.

On the other other hand, we're going to revisit configuration soon so it might
make sense to pay down this pre-existing tech debt later when we're doing the
right thing anyway.

Signed-off-by: Jamie Klassen <jklassen@vmware.com>
2020-07-06 14:35:19 -04:00
Josh Winters 47b5538bc0 Merge branch 'release/6.1.x'
Signed-off-by: Josh Winters <jwinters@pivotal.io>
2020-05-12 17:15:20 -04:00
Josh Winters 33b66078ce cmd: fix problem with the tsa-client-id auto config
Signed-off-by: Josh Winters <jwinters@pivotal.io>
2020-05-11 12:06:36 -04:00
Ciro S. Costa d397834446 cmd: ensure tsa-client & sys-claim-val match
when using the `aud` claim, these two values are coordinated, otherwise
just assumes that the user knows what they're doing.

fixes #5536

Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
Co-authored-by: Joshua Winters <jwinters@pivotal.io>
2020-05-07 12:53:47 -04:00
Jamie Klassen e1e6c89b07 cmd: structure: clean up redundant ifrit stuff
concourse/concourse#5421

This was accidentally left in frmo when @vito and I were experimenting with ways
to invoke the `concourse` binary in tests.

Signed-off-by: Jamie Klassen <cklassen@pivotal.io>
2020-05-01 09:25:48 -04:00
Alex Suraci e81ef516cb atc: behavior: bail on invalid env vars
concourse/concourse#5421

Signed-off-by: Alex Suraci <asuraci@pivotal.io>
Co-authored-by: Jamie Klassen <cklassen@pivotal.io>
2020-04-30 14:26:26 -04:00
Jamie Klassen 0687afefc5 atc: structure: flatten context in happy path
concourse/concourse#5421

I find I struggle to read such a long nested context and it seems clearer to
just describe the happy path without too many extra descriptors - in the spirit
of Gary Bernhardt, let's save our detailed conditions for the degenerate cases.

Signed-off-by: Jamie Klassen <cklassen@pivotal.io>
2020-04-30 14:26:26 -04:00
Alex Suraci 1199aaebaa derive default client secret from signing key
use the signing key to create a default client secret for the 'atc' and
'tsa' clients.

the goal here is to have a reasonable default such that operators won't
have to do anything special in order to upgrade or deploy a new
multi-web-node Concourse cluster.

requiring operators to configure these client secrets is a little bit
confusing, because they're actually for authenticating with Dex, which
we try to keep hidden away for the most part. we can still allow the
flags to be set if an operator has some reason to set their own.

Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
2020-04-13 14:43:24 -04:00
Josh Winters 72ccab9bac cmd: generate client secret defaults in web cmd
Signed-off-by: Josh Winters <jwinters@pivotal.io>
2020-04-09 12:32:23 -04:00
Josh Winters 3f9ded9f4f atc: add default flag values for client names
Signed-off-by: Josh Winters <jwinters@pivotal.io>
2020-04-06 12:47:12 -04:00
Josh Winters 16f4c6677b cmd: wire everything together
- The biggest change here is the fact that skymarshal, which is actually
3 different components (auth server, login server, legacy proxy) is now
broken up so its more obvious what each component does.

- There ends up being a lot of configuration that happens which needs to
describe how the tsa/dex/sky/api are all goign to communicate (mostly
configuring clients and auth endpoints everywhere) but since all these
things live on the same host, we can do some configuration magic in the
web cmd.

- This commit also makes things much more configurable. For instance
users can configure how we identify 'system' requests in concourse.

Signed-off-by: Josh Winters <jwinters@pivotal.io>
2020-04-06 12:47:12 -04:00
Josh Winters 74003b67d6 tsa: remove token generator
- use client credentials grant to request token

- all requests from the tsa will be treated as 'system' requests since
the tsa already handles its own authorization for team based worker
operations

- remove atc specific logic from tsa integration tests, the tsa
shouldn't care how the api handles its internal authorization

Signed-off-by: Josh Winters <jwinters@pivotal.io>
2020-04-06 12:47:11 -04:00
Ciro S. Costa becc3eefa9 cmd/init: add missing library
`perror` (which we use) comes from `stdio.h` (which we missed).

Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
2020-02-11 16:58:42 -05:00
Ciro S. Costa 104b297040 containerd: add custom init
most of the flow that takes place in the operations that we perform on
containers look like this:

	1. create a container
	2. leave it running there for few moments
	3. execute a process there

however, as a container is a process with a certain set of kernel
features enabled on it to provide a sandboxed environment, we need to
have an init process there in the first place.

this commit created `cmd/init`, which is exactly that - an executable
that takes care of ... being there! it does nothing more than waiting
for a signal to come (having marked itself as not caring about any
children in that pid namespace).

Signed-off-by: Ciro S. Costa <cscosta@pivotal.io>
2020-02-11 16:58:21 -05:00
Rui Yang b8dfeba1d9 handle help error in concourse cmd properly
following what fly cli does, so it won't exit 1 with '--help'

Signed-off-by: Rui Yang <ryang@pivotal.io>
2019-11-08 22:13:31 -05:00
Nader Ziada e5066df1db pull out workercmd from cmd/concourse
Signed-off-by: Divya Dadlani <ddadlani@pivotal.io>
Signed-off-by: Denise Yu <dyu@pivotal.io>
2019-09-12 10:00:39 -04:00
Chao Li 768f930045 feat(log): Add --log-cluster-name option to enable including cluster name in log line.
Say cluster name is "dev", them sample log lines are as below: (notice "cluster" field in logs)

web_1     | {"timestamp":"2019-09-11T00:53:59.706488300Z","level":"info","source":"atc","message":"atc.cmd.finish","data":{"cluster":"dev","duration":378200,"session":"1"}}
web_1     | {"timestamp":"2019-09-11T00:53:59.707583200Z","level":"info","source":"tsa","message":"tsa.listening","data":{"cluster":"dev"}}

Signed-off-by: Chao Li <chaol@vmware.com>
2019-09-11 08:58:41 +08:00
Alex Suraci 946ed8ad92 atc: remove env-dependent integration test
this fails if the defaults actually work on the dev's machine. i can't
really think of a good way to assert on anything useful here. :/ just
gonna remove it since it's covering for a fixed panic() which should
also be covered by the remaining tests.

Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
2019-08-13 15:22:05 -04:00
Alex Suraci ca3c26be51
Merge pull request #3864 from concourse/fix-worker-private-key-flag
cmd/concourse: fix worker private key flag
2019-05-15 09:26:12 -04:00
Alex Suraci a85d4bf93a --external-garden-address -> --external-garden-url
Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
2019-05-14 14:20:43 -04:00
Alex Suraci ae90d5052d Merge branch 'external-garden-address' of https://github.com/rkoster/concourse into rkoster-external-garden-address 2019-05-14 14:17:47 -04:00
Alex Suraci 635ac06eba cmd/concourse: fix worker private key flag
this flag should be required for the worker commands, and only optional
in 'quickstart'

Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
2019-05-14 14:13:28 -04:00
Alex Suraci f29da789cc
Merge pull request #3848 from edtan/check-session-signing-key
Check if session-signing-key is nil
2019-05-14 11:09:06 -04:00
Ed b9c7730462 Only build concourse binary once
Signed-off-by: Ed <edtan@users.noreply.github.com>
2019-05-13 17:23:34 -04:00
Ed ca76428c11 Add GinkgoParallelNode to bind-ports and extended ginkgomon timeouts
Signed-off-by: Ed <edtan@users.noreply.github.com>
2019-05-13 16:25:14 -04:00
Divya Dadlani 9f4de5029c changing max volume sweep in flight to 3
Signed-off-by: Divya Dadlani <ddadlani@pivotal.io>
Co-authored-by: Krishna Mannem <kmannem@pivotal.io>
2019-05-13 10:02:08 -04:00
Ed 36390d1e0c Check if session-signing-key is nil
Signed-off-by: Ed <edtan@users.noreply.github.com>
2019-05-12 22:49:40 -04:00
Ruben Koster 63897e9145 Added --external-garden-address flag to use non embedded garden
Signed-off-by: Ruben Koster <rkoster@starkandwayne.com>
2019-04-30 16:17:07 +02:00
Rui Yang 87e7a3d159 cmd: fix quickstart
ignore --worker-tsa-worker-private-key in quickstart cmd

Signed-off-by: Rui Yang <ryang@pivotal.io>
2019-04-23 10:53:02 -04:00
Rui Yang 9a2fdc4dde atc: move peer address flag from atc to web
Signed-off-by: Rui Yang <ryang@pivotal.io>
2019-04-09 15:40:57 -04:00
Rui Yang e727a10483 atc: replace --tsa-peer-address with --peer-address
So this flag lives in concourse binary now

concourse/concourse#3538

Signed-off-by: Rui Yang <ryang@pivotal.io>
2019-03-28 15:49:45 -04:00
Divya Dadlani 4a8fd98eaf worker: add max-in-flight flags for sweepers
Signed-off-by: Divya Dadlani <ddadlani@pivotal.io>

concourse/concourse#2833
2019-03-19 17:58:08 -04:00
Krishna Mannem 1273f54c8e worker: delete containers and volumes in batches
add a max-in-flight for the sweepers so that containers
and volumes can be deleted in parallel with a batch size
of `max-in-flight`

refactor workerCommand.Execute and make tsa.WorkerPrivateKey
explicitly required.

make both sweepers private as they don't need to be exposed.

concourse/concourse#2833

Signed-off-by: Krishna Mannem <kmannem@pivotal.io>
Co-authored-by: Divya Dadlani <ddadlani@pivotal.io>
2019-03-19 17:58:08 -04:00
Krishna Mannem 9d398b04ee worker: parallelize container and volume GC
split SweepRunner into ContainerSweeper and VolumeSweeper;
run in their own ifrit processes so that container and
volume GC can occur independently.

Signed-off-by: Krishna Mannem <kmannem@pivotal.io>
Co-authored-by: Divya Dadlani <ddadlani@pivotal.io>
2019-03-19 17:58:08 -04:00
Alex Suraci ae294f5816 rename --tsa-peer-ip to --tsa-peer-address
this can also be a DNS address, not just an IP

this looks backwards-incompatible but in practice this flag was always
auto-set by taking the host from `--peer-url`. that flag has now been
removed, and --tsa-peer-address is to be used instead, so we might as
well get the name right.

Signed-off-by: Alex Suraci <suraci.alex@gmail.com>
2019-03-16 19:22:43 +00:00
Josh Winters ccb2c4640d tsa: default peer ip to 127.0.0.1
concourse/concourse#3267

Signed-off-by: Josh Winters <jwinters@pivotal.io>
Co-authored-by: Mark Huang <mhuang@pivotal.io>
2019-03-14 15:35:16 -04:00