Skip to content

Commit 7c7073d

Browse files
committed
[ci] Merge remote-tracking branch 'origin/main' into isegall/price-metrics
Signed-off-by: Itai Segall <[email protected]>
2 parents cf0c187 + 7a85cd8 commit 7c7073d

File tree

31 files changed

+573
-472
lines changed

31 files changed

+573
-472
lines changed

.github/actions/nix/run_bash_command_in_nix/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ runs:
3535
target="default"
3636
fi
3737
38+
echo "Running command with nix version $(nix --version)"
39+
3840
# Attempt to build the nix env with retries to work around transient download failures
3941
echo "building nix env"
4042
MAX_RETRY_NIX_ENV=5
@@ -48,6 +50,7 @@ runs:
4850
fi
4951
nix develop \
5052
path:nix#$target \
53+
--verbose \
5154
--ignore-environment \
5255
--keep USER \
5356
--keep HOME \
@@ -142,6 +145,7 @@ runs:
142145
# Run the command for real within the nix environment
143146
nix develop \
144147
path:nix#$target \
148+
--verbose \
145149
--ignore-environment \
146150
--keep USER \
147151
--keep HOME \

.github/actions/nix/setup_nix/action.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ runs:
3838
shell: bash
3939
run: |
4040
set -euxo pipefail
41+
NIX_BINARY_VERSION=2.32.0
42+
echo "NIX_BINARY_VERSION=$NIX_BINARY_VERSION" >> $GITHUB_ENV
43+
cat nix/canton-sources.json
4144
git ls-files nix/ | grep -v '[.]md$' | LC_ALL=C sort | xargs sha256sum -b > /tmp/nix-cache-key
4245
uname -m >> /tmp/nix-cache-key # Add architecture to the cache key
4346
echo "gh_cache_version: ${{ inputs.cache_version }}" >> /tmp/nix-cache-key # Add cache version to the cache key
47+
echo "home: $HOME" >> /tmp/nix-cache-key # important when restoring simlinks from cache, apparently
48+
echo "nix binary version: $NIX_BINARY_VERSION" >> /tmp/nix-cache-key # different nix versions might behave differently and corrupt the caches
4449
if [ "${{ inputs.oss_only }}" == true ]; then
4550
echo "Using OSS only dependencies"
4651
echo "oss_only: ${{ inputs.oss_only }}" >> /tmp/nix-cache-key
@@ -86,8 +91,9 @@ runs:
8691
# we use rsync here because it's simply faster to install
8792
rsync -avi /cache/nix/$cache_key/.nix-* $HOME/
8893
rsync -avi "/cache/nix/$cache_key/nix" $HOME/.config/
89-
rsync -avi "/cache/nix/$cache_key/nix_store/var/" /nix/var
90-
sudo mount --bind /cache/nix/$cache_key/nix_store/store /nix/store
94+
# TODO (#2663): fix & uncomment these two lines
95+
# rsync -avi "/cache/nix/$cache_key/nix_store/var/" /nix/var
96+
# sudo mount --bind /cache/nix/$cache_key/nix_store/store /nix/store
9197
else
9298
sudo mkdir -p "/cache/nix/$cache_key"
9399
sudo chown $(whoami):$(whoami) "/cache/nix/$cache_key"
@@ -126,7 +132,7 @@ runs:
126132
max-jobs = 16
127133
EOF
128134
fi
129-
sh <(curl -fsSL --retry 8 https://releases.nixos.org/nix/nix-2.13.3/install) --no-daemon
135+
sh <(curl -fsSL --retry 8 "https://releases.nixos.org/nix/nix-$NIX_BINARY_VERSION/install") --no-daemon
130136
sudo mkdir -p /etc/nix
131137
sudo chmod a+rw /etc/nix
132138
if [[ "${{ inputs.oss_only }}" == true ]]; then
@@ -147,8 +153,6 @@ runs:
147153
target="default"
148154
fi
149155
nix develop path:nix#${target} -v --profile "$HOME/.nix-shell" --command echo "Done loading packages"
150-
echo "Garbage collecting to reduce cache size"
151-
nix-store --gc
152156
fi
153157
154158
- name: Invoke nix before saving cache
@@ -176,6 +180,9 @@ runs:
176180
export USER=$(whoami)
177181
. ~/.nix-profile/etc/profile.d/nix.sh
178182
183+
echo "Garbage collecting to reduce cache size"
184+
nix-store --gc
185+
179186
nix copy --all --to 'file:///cache/nix/binary_cache?trusted=1' -v
180187
181188
CLONE_COMMAND="rclone --no-update-dir-modtime --no-update-modtime --size-only --multi-thread-streams=32 --transfers=32 --ignore-existing --links --create-empty-src-dirs --fast-list --metadata --order-by name,mixed --retries 10 copy"
@@ -187,7 +194,8 @@ runs:
187194
188195
#requires to preserve read only during clone
189196
sudo ${CLONE_COMMAND} /nix/store/ /cache/nix/$cache_key/nix_store/store
190-
sudo ${CLONE_COMMAND} /nix/var/ "/cache/nix/$cache_key/nix_store/var"
197+
# TODO (#2663): fix & uncomment this line
198+
# sudo ${CLONE_COMMAND} /nix/var/ "/cache/nix/$cache_key/nix_store/var"
191199
192200
echo "done" > "/cache/nix/$cache_key/cached"
193201
fi

.github/actions/tests/common_test_setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ runs:
6464
with:
6565
artifactory_user: ${{ inputs.artifactory_user }}
6666
artifactory_password: ${{ inputs.artifactory_password }}
67-
cache_version: 5
67+
cache_version: 7
6868
should_save: ${{ inputs.save_nix_cache }}
6969
should_save_gcp: ${{ inputs.save_nix_cache_to_gcp }}
7070
oss_only: ${{ inputs.oss_only }}
@@ -76,4 +76,4 @@ runs:
7676
id: setup_sbt
7777
uses: ./.github/actions/sbt/setup_sbt
7878
with:
79-
cache_version: 5
79+
cache_version: 7

.github/actions/tests/scala_test/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ runs:
141141
id: setup_sbt
142142
uses: ./.github/actions/sbt/setup_sbt
143143
with:
144-
cache_version: 5
144+
cache_version: 7
145145

146146
- name: Set Daml package versions
147147
uses: ./.github/actions/nix/run_bash_command_in_nix
@@ -285,7 +285,7 @@ runs:
285285
if: ${{ !cancelled() }}
286286
uses: ./.github/actions/sbt/post_sbt
287287
with:
288-
cache_version: 5
288+
cache_version: 7
289289
setup_sbt_cache_hits: ${{ steps.setup_sbt.outputs.cache_hits }}
290290
# Save caches only from one runner, to reduce conflicts on the save
291291
save_caches: ${{ inputs.runner_index == 0 && inputs.test_suite_name == 'wall-clock-time' }}

.github/workflows/build.docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Post-SBT job
4949
uses: ./.github/actions/sbt/post_sbt
5050
with:
51-
cache_version: 5
51+
cache_version: 7
5252
setup_sbt_cache_hits: ${{ steps.setup.outputs.sbt_cache_hits }}
5353

5454
- name: Report Failures on Slack & Github

.github/workflows/build.ts_cli_tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ jobs:
2020
# Checkout the PR head commit to get the commit message first
2121
ref: ${{ github.event.pull_request.head.sha }}
2222

23-
- name: Check out repository code
24-
uses: actions/checkout@v4
25-
if: inputs.commit_sha != ''
26-
with:
27-
ref: ${{ inputs.commit_sha }}
28-
2923
- name: Check if static only
3024
uses: ./.github/actions/tests/skip_on_static
3125
id: skip
3226
with:
3327
gh_token: ${{ secrets.GITHUB_TOKEN }}
3428

29+
- name: Check out repository code
30+
uses: actions/checkout@v4
31+
if: inputs.commit_sha != ''
32+
with:
33+
ref: ${{ inputs.commit_sha }}
34+
3535
- name: Setup
3636
id: setup
3737
if: steps.skip.outputs.skip != 'true'

.github/workflows/build.ui_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
if: steps.skip.outputs.skip != 'true'
5959
uses: ./.github/actions/sbt/post_sbt
6060
with:
61-
cache_version: 5
61+
cache_version: 7
6262
setup_sbt_cache_hits: ${{ steps.setup.outputs.sbt_cache_hits }}
6363

6464
- name: Upload logs

apps/app/src/main/scala/org/lfdecentralizedtrust/splice/config/ConfigTransforms.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,12 @@ object ConfigTransforms {
333333
}
334334
)
335335

336+
def updateInitialTickDuration(tick: NonNegativeFiniteDuration): ConfigTransform = {
337+
ConfigTransforms.updateAllSvAppFoundDsoConfigs_(
338+
_.copy(initialTickDuration = tick)
339+
)
340+
}
341+
336342
def noDevNet: ConfigTransform =
337343
updateAllSvAppFoundDsoConfigs_(_.focus(_.isDevNet).replace(false))
338344

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/EnvironmentDefinition.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,12 @@ case class EnvironmentDefinition(
425425
.replace(NonNegativeFiniteDuration.Zero)
426426
)(conf)
427427
)
428+
.addConfigTransform((_, conf) =>
429+
ConfigTransforms.updateAllAutomationConfigs(
430+
// disable round based triggers because tests don't advance time for the triggers to run
431+
_.focus(_.enableNewRewardTriggerScheduling).replace(false)
432+
)(conf)
433+
)
428434
.withSequencerConnectionsFromScanDisabled(10_000)
429435

430436
override lazy val environmentFactory: EnvironmentFactory[SpliceConfig, SpliceEnvironment] =

apps/app/src/test/scala/org/lfdecentralizedtrust/splice/integration/tests/AutomationControlIntegrationTest.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ class AutomationControlIntegrationTest
2222
// start only sv1 but not sv2-4, to speed up the test
2323
.simpleTopology1Sv(this.getClass.getSimpleName)
2424
// Very short round ticks
25-
.addConfigTransforms((_, config) =>
26-
ConfigTransforms.updateAllSvAppFoundDsoConfigs_(
27-
_.copy(initialTickDuration = NonNegativeFiniteDuration.ofMillis(500))
28-
)(config)
25+
.addConfigTransform((_, config) =>
26+
ConfigTransforms.updateInitialTickDuration(NonNegativeFiniteDuration.ofMillis(500))(config)
2927
)
3028
// Start rounds trigger in paused state
3129
.addConfigTransforms((_, config) =>

0 commit comments

Comments
 (0)