Skip to content

Ci tracing - #12

Merged
sipsma merged 10 commits into
mainfrom
ci-tracing
May 17, 2022
Merged

sipsma merged 10 commits into
mainfrom
ci-tracing

Conversation

@sipsma

@sipsma sipsma commented May 11, 2022

Copy link
Copy Markdown
Owner

No description provided.

helderco and others added 3 commits May 10, 2022 09:55
The DAGGER_CACHE_{FROM,TO} env vars are set by a GHA step and previously
were just passed transparently to our integ tests. However, after
updating those tests to run in dagger, they were not being passed along
anymore.

This just updates ci.cue to explicitly pass them to the integ test
invocation.

In the long-term, it would probably be better to move the setting of
these env vars from a GHA step to within ci.cue. However, right now
since porting the universe tests to run inside dagger is still WIP it's
probably cleaner to just leave that in GHA rather than maintain it in
two places. Once everything's in dagger, it can migrate to ci.cue.

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma force-pushed the ci-tracing branch 17 times, most recently from cd39e2f to 4398513 Compare May 12, 2022 03:44
helderco added 2 commits May 12, 2022 09:52
feat: Use `client: filesystem` path as a default
fix: Course correct on `project update` consistency
@sipsma
sipsma force-pushed the ci-tracing branch 5 times, most recently from f89dea9 to b8e2b3f Compare May 12, 2022 18:11
TomChv and others added 3 commits May 12, 2022 23:30
ci: Pass cache env vars through to integ tests.
Before this, when trying to use opentelemetry libs it was possible to
get an error "cannot merge resource due to conflicting Schema URL".

The error indicates that different versions of opentelemetry are being
used at the same time. This seems to have ultimately resulted from the
fact that we setup tracers and also provide those to some Buildkit libs,
but buildkit is still on v1.4.1 while we recently upgraded to v1.7.0.

This, for reasons that are not yet clear to me, only happened in the
integration tests where the dagger client is running inside dagger. It
may have something to do with a difference in how we build dagger inside
dagger compared to when it is built directly in GHA, but not sure.

Either way, this downgrade unblocks us for the moment until we have a
better way of solving this.

Signed-off-by: Erik Sipsma <[email protected]>
This sets up Jaeger to run inside GHA during integration tests,
instruments dagger and buildkit to write to it and exports the resulting
data as an artifact of the run.

This enables us to get insight into what actually happened during our CI
runs, which is helpful for debugging and getting insight into the
performance of caching.

Jaeger seems to be mostly designed for "live" use, but it has an
experimental mode for persisting its data to disk, which I use here to
enable exporting it.

This is not a completely ideal solution. It requires setting up Buildkit
and Jaeger in docker separate from our actual test run. The much better
solution will be to use async \#Start and \#Stop tasks to run at least
Jaeger (and probably Buildkit itself too). This will allows use to
dogfood our own features and also open the interesting possibility of
making it easier for other users to setup Jaeger or other
opentelemetry-related daemons too (they can just re-use their Buildkit
infra instead of setting up something else).

\#Start will need a few more features first though, the main one being
support for sending SIGTERM before SIGKILL (right now it is just
instantly SIGKILL'd). Without that, the Jaeger data is corrupted. Once
that support is merged, we will be able to switch over to \#Start.

Signed-off-by: Erik Sipsma <[email protected]>
sipsma added 2 commits May 12, 2022 14:43
This makes exported traces easier to identify by test.

Signed-off-by: Erik Sipsma <[email protected]>
This allows you to run a single dagger do command that pulls down jaeger
data from the artifacts of a GHA run, start a local Jaeger daemon with
it and then view it in your web browser.

The dagger do command for this is printed at the end of GHA runs with
all the --with parameters filled out, for convenience.

It uses GH credentials, which it assumes you have previously setup on
your local machine via "gh auth login" (gh is the github cli).

This would be a great use-case for client-side proxying, but that
doesn't exist yet, so the Jaeger daemon will just end up listening on
the localhost of the machine running Buildkit. This is better than
nothing for now and use of SSH port forwarding can help cases where its
otherwise convenient.

It is also a bit weird in that this is a plan that is expected to just
keep running indefinitely until you cancel it (e.g. with ctrl-C).
However, I have not experienced any issues with the previously, other
than a weirdly flashing tty output while its running (which is a
separate issue).

Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma merged commit 40a15bf into main May 17, 2022
sipsma pushed a commit that referenced this pull request Jun 5, 2023
* Initial project

* Construct client and perform query.
* Implement engine connection to find connection to Dagger.
* Add query builder to build graphql query and select data from response.

* Handle error when fetching Dagger session

* Remove unused field and asserting type in Selection.build/1

* Remove unused code

* Generate code from GraphQL introspection

Closes #3

* Ensure first argument match with the module

Prevent accidentally chain function by pattern match with
module.

* Change version to 0.1.0-dev

* Generate document for functions

* Use field name from introspection not from function name

* Render deprecate functions

* Extract format doc to function

* Eliminate arg to_string conversion

* Add required & optional arguments to function doc

* Add ex_doc

* Do not export Dagger.Codegen.Compiler to doc

* Add tutorial through livebook

* Fix argument not convert to snake case in doc

* Running dagger via dagger session

* Add experiment env to Livebook tutorial

* Rename opts to args

`args` is make sense since it's arguments of graph api not options.

* Update README.md

* Create ci.yml

* Rework on obtaining session

Create a session module for talking with `dagger session` which's
start in a new process. The session accept the EngineConn pid for
passing the session info and logger function to print log line after
session is comming.

* Support graceful disconnect from dagger session

* Add mix task to run test with dagger

* Rework on GitHub CI

* Rename dagger to dagger-cue on GitHub Workflow

* Try install Dagger manually

* Use curl instead of wget

* Fix path extraction

* Do not do anything with session env disconnect

* Show dagger version in GitHub Workflow

* Fix invalid env variable

* Fix invalid env variable

* Rename lib/mix/task to lib/mix/tasks

* Eliminate to_string conversion for optional argument

Fixes #12

* Revert "Eliminate to_string conversion for optional argument"

This reverts commit ae5fc7cb35e96e4cc84571b491bf0fe3184bf444.

* Support custom timeout via Dagger.connect/1

* Fix query builder argument not adding comma separator

* Rework on optional args code generation

Fixes: #12

* Refactor how render function

* Add `Dagger.Codegen.Elixir.Function.define/4`.
* Refactor in `Dagger.Codegen.Elixir.Templates.ObjectTmpl` to define
via `Function.define/4` instead.

* Refactor function rendering

* Rename `format_function` to `format_function_body`.
* Refactor how format function name.

* Move doc generation to Function.define/5

* Move deprecated generation to Function.define/5

* Refactor required arg verification

* Change function signature code generation

* Add Dagger.Codegen.Elixir.Function tests

* Remove get variable name from type

* Check formatting in CI

* Refactor arguments doc generation

* Remove `.` in deprecated reason

* Prepare 0.1.0

* Add donation badge

* Prepare 0.1.0 round 2

* Generate a new code from Dagger 0.5.1

* Fix crash on Dagger 0.5.1

Skip `Connected to engine...` message before session comes in.

* Fix source reference not presents in docs

And include CHANGELOG in the Hex.pm page.

* Prepare 0.1.1

* Prepare 0.1.1 round 2

* Generate scalar type and no explict get id before pass to function

Closes #7
Closes #13

* Run unit test and check format concurrently

* Generate enum types

Closes #8

* Change version

* Generate type spec for object and enum types

* Refactor format module name

* Fix incorrect type generation

* Any function that accept *ID type must accept proper type instead.
* Add typespec to Enum functions.

Closes #15

* Add v0.2.0 CHANGELOG

* Optimize context transfer in CI test

* Experiment with_session/2 in mix ci.test

* Add connect schema

* Add connect schema to conform SDK guide specification.
* Separate connect timeout and query timeout.
* Add TODOs.

* Move connect schema to Dagger.Client

* Implement download CLI (#22)

Recheck the CLI in `$XDG_CACHE_HOME` before start downloading. If binary exists, use that binary, otherwise, download it from dagger site.

* Remove IO.puts in mix ci.test

* Do not swallow dagger connect message

* Returns error when execute graphql query

* Rename ci.test to dagger.ci.test

* Refactor filter type mechanism

* Move Dagger.Codegen.Compiler to new file

* Attach module name into introspection type and regenerate code

* Add Rewrite into compile pipeline

* Use mod_name in private instead of using from name

And re-generate code.

* Rename Rewrite module to Mutator

* Add mutator test

* Rename Dagger.disconnect/1 to Dagger.close/1

Updates #18

* Move Dagger.Client into Dagger.Internal

* Add option during call dagger session

* Add `:workdir` into `dagger session`.
* Remove `:config_path`.
* Cleanup `:log_output` to accept device uses by `IO.binwrite/2`.
* Use `IO.binwrite/2` instead of `IO.write/2`.

Closes #28

* Bump dagger to 0.5.3 and re-generate code

* Update dagger to 0.6.0

* Bump CI to use dagger 0.6.0

* Fix code gen for ProjectID and ProjectCommandID

* Import wingyplus/dagger_ex into sdk/elixir subdir

Signed-off-by: Gerhard Lazu <[email protected]>

* Add experimental warning to README

Signed-off-by: Gerhard Lazu <[email protected]>

* Update GitHub URL & fix path in package info

Signed-off-by: Gerhard Lazu <[email protected]>

* Add /sdk/elixir to CODEOWNERS

Signed-off-by: Gerhard Lazu <[email protected]>

* Remove rename_query_type mutator

This is still in complete and make test failures. So remove it.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Make mix dagger.ci.test exit non-zero status code when test failures

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Implement ./hack/make sdk:elixir:test and add it to CI

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Allow to configure Elixir/OTP version

And change Sync to ExitCode.

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Implement ./hack/make sdk:elixir:lint and add it to CI

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Remove sdk/elixir/.github

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Remove sdk/elixir/lib/mix/tasks/dagger.ci.test.exs

It already ported to ./hack/make sdk:elixir:[test,lint]

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Fix pipeline should be elixir, not go

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Change source url and changelog url

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Add sdk:elixir tasks description

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Fix incorrect pipeline name in sdk:elixir:lint task

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* ci: implement sdk:elixir:generate

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>

* Extract versions in constants

So that they are declared only once - single replace when needed.

Signed-off-by: Gerhard Lazu <[email protected]>

* Fix sdk/elixir gitignores

They are not repository top-level.

Signed-off-by: Gerhard Lazu <[email protected]>

---------

Signed-off-by: Thanabodee Charoenpiriyakij <[email protected]>
Co-authored-by: Gerhard Lazu <[email protected]>
sipsma pushed a commit that referenced this pull request Aug 30, 2023
* add first nodejs example

Signed-off-by: kpenfound <[email protected]>

* add first python example

Signed-off-by: kpenfound <[email protected]>

* add first bash example

Signed-off-by: kpenfound <[email protected]>

* add cli readme

Signed-off-by: kpenfound <[email protected]>

* add link to api reference

Signed-off-by: kpenfound <[email protected]>

* update python readme

Signed-off-by: kpenfound <[email protected]>

Signed-off-by: kpenfound <[email protected]>
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.

3 participants