Skip to content

Commit

Permalink
redis: add prefetched dependencies, hermetic builds and unit tests (#131
Browse files Browse the repository at this point in the history
)

* chore: add prefetched dependencies and hermetic

Updates the redis pipeline to use cachi2 and hermetic builds.

Signed-off-by: Lance Ball <[email protected]>

* chore: remove unit tests and simplify prefetch

Removes unit tests from the redis pipeline as that is not required for changes
to the Dockerfile.

Simplifies prefetch since we don't need to actually fetch anything.

Signed-off-by: Lance Ball <[email protected]>

* deps: update apache/beam to the latest sha

The cachi2 binary cannot handle go 1.21 yet. The apache/beam project
recently reverted the use of 1.21 language features in
apache/beam#30120 which should make it possible
to run prefetched dependencies in the pipeline.

Signed-off-by: Lance Ball <[email protected]>

---------

Signed-off-by: Lance Ball <[email protected]>
  • Loading branch information
lance authored Jan 31, 2024
1 parent 34590a8 commit a3fa4f7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 8 deletions.
12 changes: 9 additions & 3 deletions .tekton/redis-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ spec:
value: .
- name: revision
value: '{{revision}}'
- name: build-source-image
value: true
- name: prefetch-input
value: ''
- name: hermetic
value: "true"
pipelineSpec:
finally:
- name: show-sbom
Expand Down Expand Up @@ -190,10 +196,10 @@ spec:
value: task
resolver: bundles
when:
- input: $(params.hermetic)
operator: in
- input: $(params.prefetch-input)
operator: notin
values:
- "true"
- "{}"
workspaces:
- name: source
workspace: workspace
Expand Down
12 changes: 9 additions & 3 deletions .tekton/redis-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ spec:
value: .
- name: revision
value: '{{revision}}'
- name: build-source-image
value: true
- name: prefetch-input
value: ''
- name: hermetic
value: "true"
pipelineSpec:
finally:
- name: show-sbom
Expand Down Expand Up @@ -187,10 +193,10 @@ spec:
value: task
resolver: bundles
when:
- input: $(params.hermetic)
operator: in
- input: $(params.prefetch-input)
operator: notin
values:
- "true"
- "{}"
workspaces:
- name: source
workspace: workspace
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
bitbucket.org/creachadair/shell v0.0.8
cloud.google.com/go/spanner v1.55.0
contrib.go.opencensus.io/exporter/stackdriver v0.13.14
github.com/apache/beam/sdks/v2 v2.53.0
github.com/apache/beam/sdks/v2 v2.0.0-20240131192626-89d1c06e1eab
github.com/cockroachdb/cockroach-go/v2 v2.3.6
github.com/fullstorydev/grpcurl v1.8.9
github.com/go-redis/redis v6.15.9+incompatible
Expand Down Expand Up @@ -50,12 +50,13 @@ require (
cloud.google.com/go/longrunning v0.5.4 // indirect
cloud.google.com/go/monitoring v1.17.0 // indirect
cloud.google.com/go/profiler v0.4.0 // indirect
cloud.google.com/go/storage v1.35.1 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
cloud.google.com/go/trace v1.10.4 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver v1.5.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/apache/beam v2.2.1-0.20240131192626-89d1c06e1eab+incompatible // indirect
github.com/aws/aws-sdk-go v1.46.4 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
Expand Down
9 changes: 9 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w=
cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8=
cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8=
cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8=
cloud.google.com/go/trace v1.10.4 h1:2qOAuAzNezwW3QN+t41BtkDJOG42HywL73q8x/f6fnM=
cloud.google.com/go/trace v1.10.4/go.mod h1:Nso99EDIK8Mj5/zmB+iGr9dosS/bzWCJ8wGmE6TXNWY=
contrib.go.opencensus.io/exporter/stackdriver v0.13.14 h1:zBakwHardp9Jcb8sQHcHpXy/0+JIb1M8KjigCJzx7+4=
Expand All @@ -104,6 +106,10 @@ github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/g
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/beam v2.2.1-0.20240131192626-89d1c06e1eab+incompatible h1:u2dhI8o+UHL3N5+DRNctIb0/Hja0SiH5TPO0N9sqzPo=
github.com/apache/beam v2.2.1-0.20240131192626-89d1c06e1eab+incompatible/go.mod h1:/8NX3Qi8vGstDLLaeaU7+lzVEu/ACaQhYjeefzQ0y1o=
github.com/apache/beam/sdks/v2 v2.0.0-20240131192626-89d1c06e1eab h1:hA92Sie+mv5Cxl/i8vfo30c/4IQaNgbi3mTugIztYjE=
github.com/apache/beam/sdks/v2 v2.0.0-20240131192626-89d1c06e1eab/go.mod h1:iZcZJZMkXW51G4jc0UXJOYFyC8MKSlBa5GR+22bWFcQ=
github.com/apache/beam/sdks/v2 v2.53.0 h1:LwJeQhFtl1kCtgjHLc27iwJCdrvLnRs6/wRX47RnJ1A=
github.com/apache/beam/sdks/v2 v2.53.0/go.mod h1:z1DTI/LhCtIqKtf6/eeSCgsrko5S9TigDXfuQT/zDfI=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
Expand Down Expand Up @@ -206,6 +212,7 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/fsouza/fake-gcs-server v1.47.6 h1:/d/879q/Os9Zc5gyV3QVLfZoajN1KcWucf2zYCFeFxs=
github.com/fsouza/fake-gcs-server v1.47.6/go.mod h1:ApSXKexpG1BUXJ4f2tNCxvhTKwCPFqFLBDW2UNQDODE=
github.com/fsouza/fake-gcs-server v1.47.7 h1:56/U4rKY081TaNbq0gHWi7/71UxC2KROqcnrD9BRJhs=
github.com/fullstorydev/grpcurl v1.8.9 h1:JMvZXK8lHDGyLmTQ0ZdGDnVVGuwjbpaumf8p42z0d+c=
github.com/fullstorydev/grpcurl v1.8.9/go.mod h1:PNNKevV5VNAV2loscyLISrEnWQI61eqR0F8l3bVadAA=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
Expand Down Expand Up @@ -355,8 +362,10 @@ github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qK
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
Expand Down

0 comments on commit a3fa4f7

Please sign in to comment.