-
Notifications
You must be signed in to change notification settings - Fork 529
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
[Master] Patch missing type shapes #16154
Changes from 10 commits
4de35ad
36829c6
72c6d04
dd8dca7
7530ac4
ccf827d
42270d3
33dedec
f6f8e3d
4f16f98
b027e32
523986d
cb9eebb
1e4eec5
93fa787
64a960e
2472c2f
33cfd01
eb7ccc2
7f85c14
11362e7
2b73046
2de6151
59e6ccc
182467c
32b6d92
32aec5c
a43a260
9aa8585
8160eb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
KEY_FILE=/var/secrets/google/key.json | ||
|
||
if [ ! -f $KEY_FILE ]; then | ||
echo "Cannot use gsutil for upload as key file cannot be foud in $KEY_FILE" | ||
fi | ||
|
||
gcloud auth activate-service-account --key-file=$KEY_FILE | ||
|
||
gsutil cp $1 $2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
set -eox pipefail | ||
|
||
if [[ $# -ne 1 ]]; then | ||
echo "Usage: $0 <release-branch>" | ||
exit 1 | ||
fi | ||
|
||
git config --global --add safe.directory /workdir | ||
|
||
source buildkite/scripts/handle-fork.sh | ||
source buildkite/scripts/export-git-env-vars.sh | ||
|
||
release_branch=${REMOTE}/$1 | ||
mrmr1993 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
RELEASE_BRANCH_COMMIT=$(git log -n 1 --format="%h" --abbrev=7 $release_branch) | ||
|
||
function revert_checkout() { | ||
git checkout $BUILDKITE_COMMIT | ||
git submodule sync | ||
git submodule update --init --recursive | ||
} | ||
|
||
function checkout_and_dump() { | ||
local __commit=$1 | ||
git checkout $__commit | ||
git submodule sync | ||
git submodule update --init --recursive | ||
eval $(opam config env) | ||
TYPE_SHAPE_FILE=${__commit:0:7}-type_shape.txt | ||
dune exec src/app/cli/src/mina.exe internal dump-type-shapes > /tmp/${TYPE_SHAPE_FILE} | ||
revert_checkout | ||
source buildkite/scripts/gsutil-upload.sh /tmp/${TYPE_SHAPE_FILE} gs://mina-type-shapes | ||
} | ||
|
||
if ! $(gsutil ls gs://mina-type-shapes/$BUILDKITE_COMMIT 2>/dev/null); then | ||
checkout_and_dump $BUILDKITE_COMMIT | ||
fi | ||
|
||
if ! $(gsutil ls gs://mina-type-shapes/$RELEASE_BRANCH_COMMIT 2>/dev/null); then | ||
checkout_and_dump $RELEASE_BRANCH_COMMIT | ||
fi | ||
|
||
if [[ -n "${BUILDKITE_PULL_REQUEST_BASE_BRANCH:-}" ]]; then | ||
BUILDKITE_PULL_REQUEST_BASE_BRANCH_COMMIT=$(git log -n 1 --format="%h" --abbrev=7 ${REMOTE}/${BUILDKITE_PULL_REQUEST_BASE_BRANCH} ) | ||
if ! $(gsutil ls gs://mina-type-shapes/$BUILDKITE_PULL_REQUEST_BASE_BRANCH_COMMIT 2>/dev/null); then | ||
checkout_and_dump $BUILDKITE_PULL_REQUEST_BASE_BRANCH_COMMIT | ||
fi | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
let Cmd = ../../Lib/Cmds.dhall | ||
|
||
let S = ../../Lib/SelectFiles.dhall | ||
|
||
let B = ../../External/Buildkite.dhall | ||
|
@@ -14,12 +12,12 @@ let JobSpec = ../../Pipeline/JobSpec.dhall | |
|
||
let Command = ../../Command/Base.dhall | ||
|
||
let RunInToolchain = ../../Command/RunInToolchain.dhall | ||
|
||
let Docker = ../../Command/Docker/Type.dhall | ||
|
||
let Size = ../../Command/Size.dhall | ||
|
||
let RunInToolchain = ../../Command/RunInToolchain.dhall | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why move this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing |
||
|
||
let dependsOn = [ { name = "MinaArtifactBullseye", key = "build-deb-pkg" } ] | ||
|
||
let buildTestCmd | ||
|
@@ -34,18 +32,18 @@ let buildTestCmd | |
RunInToolchain.runInToolchain | ||
([] : List Text) | ||
"buildkite/scripts/dump-mina-type-shapes.sh" | ||
# [ Cmd.run | ||
"gsutil cp \$(git log -n 1 --format=%h --abbrev=7 --no-merges)-type_shape.txt \$MINA_TYPE_SHAPE gs://mina-type-shapes" | ||
] | ||
# RunInToolchain.runInToolchain | ||
([] : List Text) | ||
"buildkite/scripts/version-linter-patch-missing-type-shapes.sh ${release_branch}" | ||
# RunInToolchain.runInToolchain | ||
([] : List Text) | ||
"buildkite/scripts/version-linter.sh ${release_branch}" | ||
, label = "Versioned type linter for ${release_branch}" | ||
, key = "version-linter-${release_branch}" | ||
, soft_fail = Some soft_fail | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why move this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issues with merging. Removing |
||
, target = cmd_target | ||
, docker = None Docker.Type | ||
, depends_on = dependsOn | ||
, soft_fail = Some soft_fail | ||
, artifact_paths = [ S.contains "core_dumps/*" ] | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,16 @@ let module = | |
\(environment : List Text) | ||
-> let Docker = | ||
{ Type = | ||
{ image : Text, extraEnv : List Text, privileged : Bool } | ||
, default = { extraEnv = [] : List Text, privileged = False } | ||
{ image : Text | ||
, extraEnv : List Text | ||
, privileged : Bool | ||
, useBash : Bool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to be unused in this PR, and generally orthogonal to the changes. Can you remove this? |
||
} | ||
, default = | ||
{ extraEnv = [] : List Text | ||
, privileged = False | ||
, useBash = True | ||
} | ||
} | ||
|
||
let Cmd = { line : Text, readable : Optional Text } | ||
|
@@ -58,12 +66,16 @@ let module = | |
: Text | ||
= "/var/buildkite/shared" | ||
|
||
let entrypoint | ||
: Text | ||
= if docker.useBash then "/bin/bash" else "/bin/sh" | ||
|
||
in { line = | ||
"docker run -it --rm --entrypoint /bin/sh --init --volume ${sharedDir}:/shared --volume ${outerDir}:/workdir --workdir /workdir${envVars}${ if docker.privileged | ||
"docker run -it --rm --entrypoint ${entrypoint} --init --volume /var/secrets:/var/secrets --volume ${sharedDir}:/shared --volume ${outerDir}:/workdir --workdir /workdir${envVars}${ if docker.privileged | ||
|
||
then " --privileged" | ||
then " --privileged" | ||
|
||
else ""} ${docker.image} -c '${inner.line}'" | ||
else ""} ${docker.image} -c '${inner.line}'" | ||
, readable = | ||
Optional/map | ||
Text | ||
|
@@ -130,7 +142,7 @@ let tests = | |
let dockerExample = | ||
assert | ||
: { line = | ||
"docker run -it --rm --entrypoint /bin/sh --init --volume /var/buildkite/shared:/shared --volume \\\$BUILDKITE_BUILD_CHECKOUT_PATH:/workdir --workdir /workdir --env ENV1 --env ENV2 --env TEST foo/bar:tag -c 'echo hello'" | ||
"docker run -it --rm --entrypoint /bin/bash --init --volume /var/secrets:/var/secrets --volume /var/buildkite/shared:/shared --volume \\\$BUILDKITE_BUILD_CHECKOUT_PATH:/workdir --workdir /workdir --env ENV1 --env ENV2 --env TEST foo/bar:tag -c 'echo hello'" | ||
, readable = Some "Docker@foo/bar:tag ( echo hello )" | ||
} | ||
=== M.inDocker | ||
|
@@ -142,7 +154,7 @@ let tests = | |
|
||
let cacheExample = | ||
assert | ||
: "./buildkite/scripts/cache-through.sh data.tar \"docker run -it --rm --entrypoint /bin/sh --init --volume /var/buildkite/shared:/shared --volume \\\$BUILDKITE_BUILD_CHECKOUT_PATH:/workdir --workdir /workdir --env ENV1 --env ENV2 --env TEST foo/bar:tag -c 'echo hello > /tmp/data/foo.txt && tar cvf data.tar /tmp/data'\"" | ||
: "./buildkite/scripts/cache-through.sh data.tar \"docker run -it --rm --entrypoint /bin/bash --init --volume /var/secrets:/var/secrets --volume /var/buildkite/shared:/shared --volume \\\$BUILDKITE_BUILD_CHECKOUT_PATH:/workdir --workdir /workdir --env ENV1 --env ENV2 --env TEST foo/bar:tag -c 'echo hello > /tmp/data/foo.txt && tar cvf data.tar /tmp/data'\"" | ||
=== M.format | ||
( M.cacheThrough | ||
M.Docker::{ | ||
|
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.
Why is this now necessary?
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.
We did an effort recently to setup agents in a way that now env vars which allows to correctly setup gsutil are passed to toolchain and allow us to upload file to gs directly from toolchain. Previously we had to ran gsutil directly from agent which was a bit of dance (dumping file on toolchains, then uploading on agents level).
In
VersionLinter.dhall
i removed line with upload to gcloud bucket