-
Notifications
You must be signed in to change notification settings - Fork 56
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
Move from Buildkite to GitHub Actions #1115
Conversation
bootstrap script is in the sytest-* containers, and I was running their version instead of the version in the checkout. Confusing!!
Getting somewhere
was just to force actions to trigger in my fork.
Suggest we keep using BuildKite for a bit and see how this fares---then can turn off the webhook and remove the config from matrix-org/pipelines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't say I know why the Dendrite run is appearing to fail. I don't see where the tap formatting script would return something other than 0 - is that failure flaky or deterministic?
Overall this is looking great. The linked output is very clean, and the resulting pipeline file doubly so!
Most of my comments are just clarifications.
# synapse_sytest.sh expects a synapse checkout at /src | ||
- ${{ github.workspace }}/synapse:/src | ||
env: | ||
POSTGRES: ${{ matrix.postgres && 1 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is && 1
a trick to say that this should be enabled by default?
Why don't we do the same for dendrite's runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. With that said, it looks to me that dendrite_sytest.sh only ever uses postgres. Maybe the BuildKite config I've been adapting was mistaken?
The script always sets up postgres. Some other bits of perl then determine if we're going to actually use postgres. Need to ensure $POSTGRES is non-empty iff we want to use SQLite.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not sure if I understand. If POSTGRES
is empty, then we set it to true/1 instead...?
Is the same required for BLACKLIST
and API
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm. I think I wrote out a larger comment but that seems to have disappeared.
I think it might be helpful to work through the details from scratch.
What the vars actually do
POSTGRES
POSTGRES
is handled differently for synapse and dendrite.
- In
synapse_sytest.sh
we only readPOSTGRES
in tests[ -n "$POSTGRES" ]
. We needPOSTGRES
to be empty or not set for SQLite, and nonempty to use postgres. - In
Dendrite.pm
we test ifPOSTGRES
is not defined or equal to'0'
, and use SQLlite otherwise.
Taking both behaviours into account:
- to use postgres, set
POSTGRES
to any non-empty string other than'0'
- to use sqllite, don't define
POSTGRES
WORKERS
Synapse only. Tested with [ -n "$WORKERS" ]
.
API
Only for dendrite. If $ENV{'API'} == '1'
in Dendrite.pm
, we'll pass -api
to dendrite. Not sure how that will handle the var being undefined.
BLACKLIST
Only for synapse. If "$BLACKLIST"
is empty (test -z
) then we set BLACKLIST=sytest-blacklist
. It ends up getting passed to run-tests.pl
via -B
.
GitHub Actions' expression language
The language is typed, but presumably ${{ expr }}
converts expr
to a string before substituting it into the yaml.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the best way to experiment was to run a dummy action here: https://github.com/DMRobertson/gha-test/
As far as I can tell, a && b
returns a
if a
is falsey, otherwise b
. No type conversion done on the value that gets returned.
The two cases then:
-
when
postgres
isn't included in the strategy matrixmatrix.postgres
isnull
null && 1
evaluates to null.${{ null }}
subsitutes the textnull
into the yaml file.- we end up with a yaml KV pair
POSTGRES: null
- GHA interprets this as "don't set
POSTGRES
"
-
when
postgres: postgres
is in the strategy matrixmatrix.postgres
is'postgres'
'postgres && 1
is1
${{ 1 }}
substitutes the textnull
into the yaml file- yaml KV
POSTGRES: 1
- GHA sets the
POSTGRES
env var to the string1
I'm about to add a commit which confirms this by dumping the environment before we call the bootstrap script.
Co-authored-by: Andrew Morgan <[email protected]>
Need to ensure that API and POSTGRES are the empty strings for dendrite when they're meant to be off. But ${{ matrix.api == 'full-http' && foo }} seems to yield either foo or `false`. Stick with what we know works.
but only on BUILDKITE. Keep this around until we're confident with the GHA workflow.
@anoadragon453 Updated as per your comments, (many thanks). These runs might be of interest: |
- Don't use API for synapse; use right matrix key for WORKERS - echo env vars before we invoke bootstrap script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for answering my query in so much detail! I'm afraid at the moment that your links seem to lead to a private repository that I can't access. I'd like to take a look at the CI runs before approving.
Thanks for tackling the other items as well. Very small nits below in the meantime.
@@ -201,6 +201,7 @@ rsync --ignore-missing-args --min-size=1B -av /work/server-0 /work/server-1 /log | |||
#export TOP=/src | |||
#/venv/bin/coverage combine | |||
|
|||
# Generate annotate.md This is Buildkite-specific. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Generate annotate.md This is Buildkite-specific. | |
# Generate annotate.md. This is Buildkite-specific. |
.github/workflows/pipeline.yml
Outdated
@@ -20,23 +20,23 @@ jobs: | |||
fail-fast: false | |||
matrix: | |||
include: | |||
- label: Python 3.6 / SQLite / Monolith | |||
- label: Py3.6 / SQLite / Monolith |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bionic has SQLite 3.22.0 - it can be useful to list it, we've had issues with older SQLite's in the past.
Oh bugger. I initially had a public fork where I was testing this stuff out. It looks like I've gone on to delete that fork, presumably when I realised the done thing was to make a branch within the main matrix-org repo. That is unfortunate and presumably means that all the actions runs are gone. I think it might be best to push the branch I was working on directly to the main sytest repo and open a new pull request. |
Oh, I've just realised I reviewed the other PR while it was marked as a draft. I'm not sure if that PR was intended just to show off the CI or whether we were moving discussion there. Either way, ✔️ on the other PR. |
See the other PR, #1127 |
Suggest we leave Buildkite running in parallel for the time being. In particular we want to ensure that the cross-branch synapse-sytest and dendrite-sytest stuff works. Co-authored-by: Andrew Morgan <[email protected]>
In #1115 I didn't correctly handle the situation where there's a corresponding synapse/dendrite branch to fetch. #1128 fell victim to this. Fix: reuse the shell script from matrix-org/synapse#10160, i.e. consult a wider range of GHA's environment variables. Co-authored-by: Andrew Morgan <[email protected]>
Ended up with a fairly direct translation from Buildkite to GHA. I tried to make more use of actions and so on, but generally found this to be more trouble that it's worth.