From dfc22aee8eac437e190639b74278013578aceb02 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 18:31:31 -0400 Subject: [PATCH 1/9] fix tests --- veilid-core/src/crypto/mod.rs | 14 +++----------- veilid-core/src/routing_table/mod.rs | 14 +++----------- veilid-server/src/settings.rs | 2 +- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/veilid-core/src/crypto/mod.rs b/veilid-core/src/crypto/mod.rs index 966633dd..879b5194 100644 --- a/veilid-core/src/crypto/mod.rs +++ b/veilid-core/src/crypto/mod.rs @@ -146,17 +146,9 @@ impl Crypto { { let c = self.unlocked_inner.config.get(); for ck in VALID_CRYPTO_KINDS { - cache_validity_key.append( - &mut c - .network - .routing_table - .node_id - .get(ck) - .unwrap() - .value - .bytes - .to_vec(), - ); + if let Some(nid) = c.network.routing_table.node_id.get(ck) { + cache_validity_key.append(&mut nid.value.bytes.to_vec()); + } } }; diff --git a/veilid-core/src/routing_table/mod.rs b/veilid-core/src/routing_table/mod.rs index 97279d08..42b4be0f 100644 --- a/veilid-core/src/routing_table/mod.rs +++ b/veilid-core/src/routing_table/mod.rs @@ -351,17 +351,9 @@ impl RoutingTable { { let c = self.unlocked_inner.config.get(); for ck in VALID_CRYPTO_KINDS { - cache_validity_key.append( - &mut c - .network - .routing_table - .node_id - .get(ck) - .unwrap() - .value - .bytes - .to_vec(), - ); + if let Some(nid) = c.network.routing_table.node_id.get(ck) { + cache_validity_key.append(&mut nid.value.bytes.to_vec()); + } } for b in &c.network.routing_table.bootstrap { cache_validity_key.append(&mut b.as_bytes().to_vec()); diff --git a/veilid-server/src/settings.rs b/veilid-server/src/settings.rs index a38d861b..0fc09ce9 100644 --- a/veilid-server/src/settings.rs +++ b/veilid-server/src/settings.rs @@ -1580,7 +1580,7 @@ mod tests { // assert_eq!( s.core.network.routing_table.bootstrap, - vec!["bootstrap.dev.veilid.net".to_owned()] + vec!["bootstrap.veilid.net".to_owned()] ); // assert_eq!(s.core.network.rpc.concurrency, 0); From 2b2b3dff77a255cf78e4f262a608e9b8628a3557 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 20:18:45 -0400 Subject: [PATCH 2/9] speed up builds --- .gitlab-ci.yml | 62 +++++++++++--------------------------------------- 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 436a9c56..9523d93e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,74 +5,38 @@ variables: GIT_SUBMODULE_STRATEGY: normal stages: - - build - test - - package - distribute before_script: - earthly bootstrap -build_amd64: - stage: build - only: - - main - - merge_requests - image: earthly/earthly:v0.6.30 - tags: - - linux - - amd64 - script: - - earthly +build-linux-amd64 - when: manual - test_amd64: stage: test - needs: - - job: build_amd64 + image: earthly/earthly:v0.6.30 only: - - main + - test-caching + - merge_requests tags: - linux - amd64 + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - - earthly +unit-tests-linux-amd64 - -package_amd64: - stage: package - needs: - - job: test_amd64 - only: - - main - tags: - - linux - - amd64 - script: - - earthly +package-linux-amd64 - + - earthly --ci --remote-cache=veilid/main-branch-cache:cache +unit-tests-linux-amd64 + when: manual distribute_amd64: stage: distribute needs: - - job: package_amd64 + - job: test_amd64 only: - - main + - test-caching tags: - linux - amd64 + before_script: + - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY script: - - earthly +package-linux-amd64 - - /home/gitlab-runner/distribute-packages.sh - - -#earthly-arm64: -# stage: linux-arm64 -# only: -# - main -# - merge_requests -# image: earthly/earthly:v0.6.30 -# tags: -# - linux -# - amd64 -# script: -# - earthly --ci -P +package-linux-arm64 + - earthly --remote-cache=veilid/main-branch-cache:cache +package-linux-amd64 + # - /home/gitlab-runner/distribute-packages.sh From 01fd161b46f866168af4676a599278c7e086900a Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 20:20:28 -0400 Subject: [PATCH 3/9] clean up warning --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9523d93e..18ea790a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ test_amd64: - linux - amd64 before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - echo "${REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" script: - earthly --ci --remote-cache=veilid/main-branch-cache:cache +unit-tests-linux-amd64 when: manual @@ -36,7 +36,7 @@ distribute_amd64: - linux - amd64 before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY + - echo "${REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" script: - earthly --remote-cache=veilid/main-branch-cache:cache +package-linux-amd64 # - /home/gitlab-runner/distribute-packages.sh From 83df76288c077754e1f45896e0829345a134b86e Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 20:26:37 -0400 Subject: [PATCH 4/9] fix login --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 18ea790a..3b17239d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ test_amd64: - linux - amd64 before_script: - - echo "${REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" + - echo "${CI_REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${CI_REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" script: - earthly --ci --remote-cache=veilid/main-branch-cache:cache +unit-tests-linux-amd64 when: manual @@ -36,7 +36,7 @@ distribute_amd64: - linux - amd64 before_script: - - echo "${REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" + - echo "${CI_REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${CI_REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" script: - earthly --remote-cache=veilid/main-branch-cache:cache +package-linux-amd64 # - /home/gitlab-runner/distribute-packages.sh From 87a801c41f3218ac9cc57c006b639458a965b094 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 20:46:22 -0400 Subject: [PATCH 5/9] whatever --- .gitlab-ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b17239d..c63d3058 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,8 +20,6 @@ test_amd64: tags: - linux - amd64 - before_script: - - echo "${CI_REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${CI_REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" script: - earthly --ci --remote-cache=veilid/main-branch-cache:cache +unit-tests-linux-amd64 when: manual @@ -35,8 +33,6 @@ distribute_amd64: tags: - linux - amd64 - before_script: - - echo "${CI_REGISTRY_PASSWORD:?}" | docker login --password-stdin -u "${CI_REGISTRY_USER:?}" -- "${CI_REGISTRY:?}" script: - earthly --remote-cache=veilid/main-branch-cache:cache +package-linux-amd64 # - /home/gitlab-runner/distribute-packages.sh From 6d0db5a6ab807c6e75a9bbeaa7b95b813bf22049 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 20:47:11 -0400 Subject: [PATCH 6/9] whatever --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c63d3058..3873b0d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,7 @@ test_amd64: - linux - amd64 script: - - earthly --ci --remote-cache=veilid/main-branch-cache:cache +unit-tests-linux-amd64 + - earthly --ci +unit-tests-linux-amd64 when: manual distribute_amd64: @@ -34,5 +34,5 @@ distribute_amd64: - linux - amd64 script: - - earthly --remote-cache=veilid/main-branch-cache:cache +package-linux-amd64 + - earthly +package-linux-amd64 # - /home/gitlab-runner/distribute-packages.sh From 4ffcd7d3b7c948294d6ef0b49aec75df9cf44202 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 22 Jun 2023 21:38:04 -0400 Subject: [PATCH 7/9] switch to main --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3873b0d7..bb11e337 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,7 +15,7 @@ test_amd64: stage: test image: earthly/earthly:v0.6.30 only: - - test-caching + - main - merge_requests tags: - linux @@ -29,10 +29,10 @@ distribute_amd64: needs: - job: test_amd64 only: - - test-caching + - main tags: - linux - amd64 script: - earthly +package-linux-amd64 - # - /home/gitlab-runner/distribute-packages.sh + - /home/gitlab-runner/distribute-packages.sh From 48be959845294277dd89655c14fba099ee7d62cb Mon Sep 17 00:00:00 2001 From: TC Johnson Date: Fri, 23 Jun 2023 13:18:15 +0000 Subject: [PATCH 8/9] Switched distribute stage to fire on merges to stable branch --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bb11e337..a948f5c8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,7 +29,7 @@ distribute_amd64: needs: - job: test_amd64 only: - - main + - stable tags: - linux - amd64 From c59cfbbc5981dc8bfcb851c80c926746036a877c Mon Sep 17 00:00:00 2001 From: TC Johnson Date: Fri, 23 Jun 2023 13:20:00 +0000 Subject: [PATCH 9/9] Removed distribute stage's dependency on test stage --- .gitlab-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a948f5c8..d002c277 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,8 +26,6 @@ test_amd64: distribute_amd64: stage: distribute - needs: - - job: test_amd64 only: - stable tags: