You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-31 09:24:31 +03:00
Bump the OTEL crates to 0.19.0 (#1132)
* Bump the OTEL crates to 0.19.0 Also pins a bunch of versions in the Dockerfile and fixes the docker build in CI
This commit is contained in:
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@ -29,7 +29,7 @@ jobs:
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.0.1
|
||||
with:
|
||||
version: 0.47.3
|
||||
version: 0.51.0
|
||||
|
||||
- name: Lint policies
|
||||
working-directory: ./policies
|
||||
@ -189,7 +189,7 @@ jobs:
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.0.1
|
||||
with:
|
||||
version: 0.47.3
|
||||
version: 0.51.0
|
||||
|
||||
- name: Compile OPA policies
|
||||
working-directory: ./policies
|
||||
@ -246,7 +246,7 @@ jobs:
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.0.1
|
||||
with:
|
||||
version: 0.47.3
|
||||
version: 0.51.0
|
||||
|
||||
- name: Compile OPA policies
|
||||
working-directory: ./policies
|
||||
@ -308,7 +308,7 @@ jobs:
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.0.1
|
||||
with:
|
||||
version: 0.47.3
|
||||
version: 0.51.0
|
||||
|
||||
- name: Compile OPA policies
|
||||
working-directory: ./policies
|
||||
@ -416,7 +416,8 @@ jobs:
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
${{ steps.meta-debug.outputs.bake-file }}
|
||||
set: |
|
||||
base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
|
||||
# This is broken: https://github.com/docker/bake-action/issues/136
|
||||
# base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
|
||||
base.platform=linux/amd64
|
||||
base.cache-from=type=registry,ref=${{ env.IMAGE }}:buildcache
|
||||
|
||||
@ -430,7 +431,8 @@ jobs:
|
||||
${{ steps.meta.outputs.bake-file }}
|
||||
${{ steps.meta-debug.outputs.bake-file }}
|
||||
set: |
|
||||
base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
|
||||
# This is broken: https://github.com/docker/bake-action/issues/136
|
||||
# base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
|
||||
base.output=type=image,push=true
|
||||
base.cache-from=type=registry,ref=${{ env.IMAGE }}:buildcache
|
||||
base.cache-to=type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max
|
||||
|
148
Cargo.lock
generated
148
Cargo.lock
generated
@ -2092,12 +2092,6 @@ dependencies = [
|
||||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fixedbitset"
|
||||
version = "0.4.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.25"
|
||||
@ -3779,12 +3773,6 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "multimap"
|
||||
version = "0.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
@ -3950,9 +3938,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry"
|
||||
version = "0.18.0"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69d6c3d7288a106c0a363e4b0e8d308058d56902adefb16f4936f417ffef086e"
|
||||
checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f"
|
||||
dependencies = [
|
||||
"opentelemetry_api",
|
||||
"opentelemetry_sdk",
|
||||
@ -3960,9 +3948,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-http"
|
||||
version = "0.7.0"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1edc79add46364183ece1a4542592ca593e6421c60807232f5b8f7a31703825d"
|
||||
checksum = "a819b71d6530c4297b49b3cae2939ab3a8cc1b9f382826a1bc29dd0ca3864906"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes 1.4.0",
|
||||
@ -3974,9 +3962,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-jaeger"
|
||||
version = "0.17.0"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e785d273968748578931e4dc3b4f5ec86b26e09d9e0d66b55adda7fce742f7a"
|
||||
checksum = "08e028dc9f4f304e9320ce38c80e7cf74067415b1ad5a8750a38bae54a4d450d"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"futures 0.3.28",
|
||||
@ -3993,16 +3981,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-otlp"
|
||||
version = "0.11.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d1c928609d087790fc936a1067bdc310ae702bdf3b090c3f281b713622c8bbde"
|
||||
checksum = "8af72d59a4484654ea8eb183fea5ae4eb6a41d7ac3e3bae5f4d2a282a3a7d3ca"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"futures 0.3.28",
|
||||
"futures-util",
|
||||
"http",
|
||||
"opentelemetry",
|
||||
"opentelemetry-http",
|
||||
"opentelemetry-proto",
|
||||
"prost",
|
||||
"thiserror",
|
||||
@ -4012,9 +3999,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-prometheus"
|
||||
version = "0.11.0"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "06c3d833835a53cf91331d2cfb27e9121f5a95261f31f08a1f79ab31688b8da8"
|
||||
checksum = "9a9f186f6293ebb693caddd0595e66b74a6068fa51048e26e0bf9c95478c639c"
|
||||
dependencies = [
|
||||
"opentelemetry",
|
||||
"prometheus",
|
||||
@ -4023,32 +4010,31 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-proto"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d61a2f56df5574508dd86aaca016c917489e589ece4141df1b5e349af8d66c28"
|
||||
checksum = "045f8eea8c0fa19f7d48e7bc3128a39c2e5c533d5c61298c548dfefc1064474c"
|
||||
dependencies = [
|
||||
"futures 0.3.28",
|
||||
"futures-util",
|
||||
"opentelemetry",
|
||||
"prost",
|
||||
"tonic",
|
||||
"tonic-build",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-semantic-conventions"
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b02e0230abb0ab6636d18e2ba8fa02903ea63772281340ccac18e0af3ec9eeb"
|
||||
checksum = "24e33428e6bf08c6f7fcea4ddb8e358fab0fe48ab877a87c70c6ebe20f673ce5"
|
||||
dependencies = [
|
||||
"opentelemetry",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry-zipkin"
|
||||
version = "0.16.0"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9bd6a5d672fe50f682d801f6737a54a633834cf8c91be419c0c9cae8ac85bf4d"
|
||||
checksum = "e1fd48caee5e1db71454c95be32d1daeb6fae265321ff8f51b1efc8a50b0be80"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"futures-core",
|
||||
@ -4065,25 +4051,25 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry_api"
|
||||
version = "0.18.0"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c24f96e21e7acc813c7a8394ee94978929db2bcc46cf6b5014fc612bf7760c22"
|
||||
checksum = "ed41783a5bf567688eb38372f2b7a8530f5a607a4b49d38dd7573236c23ca7e2"
|
||||
dependencies = [
|
||||
"fnv",
|
||||
"futures-channel",
|
||||
"futures-util",
|
||||
"indexmap",
|
||||
"js-sys",
|
||||
"once_cell",
|
||||
"pin-project-lite",
|
||||
"thiserror",
|
||||
"urlencoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "opentelemetry_sdk"
|
||||
version = "0.18.0"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ca41c4933371b61c2a2f214bf16931499af4ec90543604ec828f7a625c09113"
|
||||
checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"crossbeam-channel",
|
||||
@ -4103,9 +4089,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "ordered-float"
|
||||
version = "1.1.1"
|
||||
version = "2.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7"
|
||||
checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87"
|
||||
dependencies = [
|
||||
"num-traits",
|
||||
]
|
||||
@ -4363,16 +4349,6 @@ dependencies = [
|
||||
"sha2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "petgraph"
|
||||
version = "0.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4"
|
||||
dependencies = [
|
||||
"fixedbitset",
|
||||
"indexmap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "phf"
|
||||
version = "0.10.1"
|
||||
@ -4572,16 +4548,6 @@ version = "0.2.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
|
||||
|
||||
[[package]]
|
||||
name = "prettyplease"
|
||||
version = "0.1.25"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.56",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "primeorder"
|
||||
version = "0.13.1"
|
||||
@ -4657,28 +4623,6 @@ dependencies = [
|
||||
"prost-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-build"
|
||||
version = "0.11.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270"
|
||||
dependencies = [
|
||||
"bytes 1.4.0",
|
||||
"heck",
|
||||
"itertools",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"multimap",
|
||||
"petgraph",
|
||||
"prettyplease",
|
||||
"prost",
|
||||
"prost-types",
|
||||
"regex",
|
||||
"syn 1.0.109",
|
||||
"tempfile",
|
||||
"which",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-derive"
|
||||
version = "0.11.9"
|
||||
@ -4692,15 +4636,6 @@ dependencies = [
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "prost-types"
|
||||
version = "0.11.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13"
|
||||
dependencies = [
|
||||
"prost",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "protobuf"
|
||||
version = "2.28.0"
|
||||
@ -6001,9 +5936,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thrift"
|
||||
version = "0.16.0"
|
||||
version = "0.17.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "09678c4cdbb4eed72e18b7c2af1329c69825ed16fcbac62d083fc3e2b0590ff0"
|
||||
checksum = "7e54bc85fc7faa8bc175c4bab5b92ba8d9a3ce893d0e9f42cc455c8ab16a9e09"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"integer-encoding",
|
||||
@ -6238,19 +6173,6 @@ dependencies = [
|
||||
"tracing-futures",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tonic-build"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4"
|
||||
dependencies = [
|
||||
"prettyplease",
|
||||
"proc-macro2 1.0.56",
|
||||
"prost-build",
|
||||
"quote 1.0.26",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower"
|
||||
version = "0.4.13"
|
||||
@ -6382,9 +6304,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tracing-opentelemetry"
|
||||
version = "0.18.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21ebb87a95ea13271332df069020513ab70bdb5637ca42d6e492dc3bbbad48de"
|
||||
version = "0.19.0"
|
||||
source = "git+https://github.com/jaysonsantos/tracing-opentelemetry.git?rev=76b0a0fe45fd53c352e8bfdcdfad775aed727e4c#76b0a0fe45fd53c352e8bfdcdfad775aed727e4c"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"opentelemetry",
|
||||
@ -6429,9 +6350,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
|
||||
|
||||
[[package]]
|
||||
name = "typed-builder"
|
||||
version = "0.9.1"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a46ee5bd706ff79131be9c94e7edcb82b703c487766a114434e5790361cf08c5"
|
||||
checksum = "6179333b981641242a768f30f371c9baccbfcc03749627000c500ab88bf4528b"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.56",
|
||||
"quote 1.0.26",
|
||||
@ -7087,17 +7008,6 @@ dependencies = [
|
||||
"rustls-webpki",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "which"
|
||||
version = "4.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269"
|
||||
dependencies = [
|
||||
"either",
|
||||
"libc",
|
||||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "whoami"
|
||||
version = "1.4.0"
|
||||
|
@ -11,4 +11,9 @@ opt-level = 3
|
||||
# Until https://github.com/dylanhart/ulid-rs/pull/56 gets released
|
||||
[patch.crates-io.ulid]
|
||||
git = "https://github.com/dylanhart/ulid-rs.git"
|
||||
rev = "0b9295c2db2114cd87aa19abcc1fc00c16b272db"
|
||||
rev = "0b9295c2db2114cd87aa19abcc1fc00c16b272db"
|
||||
|
||||
# Until https://github.com/tokio-rs/tracing-opentelemetry/pull/12 gets merged and released
|
||||
[patch.crates-io.tracing-opentelemetry]
|
||||
git = "https://github.com/jaysonsantos/tracing-opentelemetry.git"
|
||||
rev = "76b0a0fe45fd53c352e8bfdcdfad775aed727e4c"
|
99
Dockerfile
99
Dockerfile
@ -15,8 +15,11 @@ ARG DEBIAN_VERSION_NAME=bullseye
|
||||
ARG RUSTC_VERSION=1.69.0
|
||||
# XXX: Upgrade to 0.10.0 blocked by https://github.com/ziglang/zig/issues/10915#issuecomment-1354548110
|
||||
ARG ZIG_VERSION=0.9.1
|
||||
ARG NODEJS_VERSION=18
|
||||
ARG OPA_VERSION=0.48.0
|
||||
ARG NODEJS_VERSION=18.16.0
|
||||
ARG OPA_VERSION=0.51.0
|
||||
ARG CARGO_AUDITABLE_VERSION=0.6.1
|
||||
ARG CARGO_CHEF_VERSION=0.1.59
|
||||
ARG CARGO_ZIGBUILD_VERSION=0.16.7
|
||||
|
||||
##########################################
|
||||
## Build stage that builds the frontend ##
|
||||
@ -26,14 +29,17 @@ FROM --platform=${BUILDPLATFORM} docker.io/library/node:${NODEJS_VERSION}-${DEBI
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY ./frontend/package.json ./frontend/package-lock.json /app/frontend/
|
||||
RUN npm ci
|
||||
# Network access: to fetch dependencies
|
||||
RUN --network=default \
|
||||
npm ci
|
||||
|
||||
COPY ./frontend/ /app/frontend/
|
||||
COPY ./templates/ /app/templates/
|
||||
RUN npm run build
|
||||
RUN --network=none \
|
||||
npm run build
|
||||
|
||||
# Move the built files
|
||||
RUN \
|
||||
RUN --network=none \
|
||||
mkdir -p /share/assets && \
|
||||
cp ./dist/manifest.json /share/manifest.json && \
|
||||
rm -f ./dist/index.html* ./dist/manifest.json* && \
|
||||
@ -42,7 +48,7 @@ RUN \
|
||||
##############################################
|
||||
## Build stage that builds the OPA policies ##
|
||||
##############################################
|
||||
FROM --platform=${BUILDPLATFORM} docker.io/library/debian:${DEBIAN_VERSION_NAME} AS policy
|
||||
FROM --platform=${BUILDPLATFORM} docker.io/library/buildpack-deps:${DEBIAN_VERSION_NAME} AS policy
|
||||
|
||||
ARG BUILDOS
|
||||
ARG BUILDARCH
|
||||
@ -53,46 +59,60 @@ ADD --chmod=755 https://github.com/open-policy-agent/opa/releases/download/v${OP
|
||||
|
||||
WORKDIR /app/policies
|
||||
COPY ./policies /app/policies
|
||||
RUN make -B
|
||||
RUN chmod a+r ./policy.wasm
|
||||
RUN --network=none \
|
||||
make -B && \
|
||||
chmod a+r ./policy.wasm
|
||||
|
||||
##########################################################################
|
||||
## Base image with cargo-chef and the right cross-compilation toolchain ##
|
||||
##########################################################################
|
||||
FROM --platform=${BUILDPLATFORM} docker.io/library/rust:${RUSTC_VERSION}-${DEBIAN_VERSION_NAME} AS toolchain
|
||||
|
||||
ARG ZIG_VERSION
|
||||
ARG CARGO_AUDITABLE_VERSION
|
||||
ARG CARGO_CHEF_VERSION
|
||||
ARG CARGO_ZIGBUILD_VERSION
|
||||
ARG RUSTC_VERSION
|
||||
ARG ZIG_VERSION
|
||||
|
||||
# Make cargo use the git cli for fetching dependencies
|
||||
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
|
||||
|
||||
# Install the protobuf compiler
|
||||
RUN apt update && apt install -y --no-install-recommends \
|
||||
protobuf-compiler
|
||||
# Install pinned versions of cargo-chef, cargo-zigbuild and cargo-auditable
|
||||
# Network access: to fetch dependencies
|
||||
RUN --network=default \
|
||||
cargo install --locked \
|
||||
cargo-chef@=${CARGO_CHEF_VERSION} \
|
||||
cargo-zigbuild@=${CARGO_ZIGBUILD_VERSION} \
|
||||
cargo-auditable@=${CARGO_AUDITABLE_VERSION}
|
||||
|
||||
# Download zig compiler for cross-compilation
|
||||
RUN curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | tar -J -x -C /usr/local && \
|
||||
# Network access: to download zig
|
||||
RUN --network=default \
|
||||
curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | tar -J -x -C /usr/local && \
|
||||
ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
|
||||
|
||||
WORKDIR /app
|
||||
RUN cargo install --locked cargo-chef cargo-zigbuild cargo-auditable
|
||||
|
||||
# Install all cross-compilation targets
|
||||
RUN rustup target add --toolchain "${RUSTC_VERSION}" \
|
||||
x86_64-unknown-linux-musl \
|
||||
aarch64-unknown-linux-musl
|
||||
# Network access: to download the targets
|
||||
RUN --network=default \
|
||||
rustup target add \
|
||||
--toolchain "${RUSTC_VERSION}" \
|
||||
x86_64-unknown-linux-musl \
|
||||
aarch64-unknown-linux-musl
|
||||
|
||||
# Helper script that transforms docker platforms to LLVM triples
|
||||
COPY ./misc/docker-arch-to-rust-target.sh /
|
||||
|
||||
# Set the working directory
|
||||
WORKDIR /app
|
||||
|
||||
#####################################
|
||||
## Run the planner from cargo-chef ##
|
||||
#####################################
|
||||
FROM --platform=${BUILDPLATFORM} toolchain AS planner
|
||||
COPY ./Cargo.toml ./Cargo.lock /app/
|
||||
COPY ./crates /app/crates
|
||||
RUN cargo chef prepare --recipe-path recipe.json --bin crates/cli
|
||||
RUN --network=none \
|
||||
cargo chef prepare --recipe-path recipe.json --bin crates/cli
|
||||
|
||||
########################
|
||||
## Actual build stage ##
|
||||
@ -103,30 +123,35 @@ ARG TARGETPLATFORM
|
||||
|
||||
# Build dependencies
|
||||
COPY --from=planner /app/recipe.json recipe.json
|
||||
RUN cargo chef cook \
|
||||
--zigbuild \
|
||||
--bin mas-cli \
|
||||
--release \
|
||||
--recipe-path recipe.json \
|
||||
--no-default-features \
|
||||
--features docker \
|
||||
--target $(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}") \
|
||||
--package mas-cli
|
||||
# Network access: cargo-chef cook fetches the dependencies
|
||||
RUN --network=default \
|
||||
cargo chef cook \
|
||||
--zigbuild \
|
||||
--bin mas-cli \
|
||||
--release \
|
||||
--recipe-path recipe.json \
|
||||
--no-default-features \
|
||||
--features docker \
|
||||
--target "$(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}")" \
|
||||
--package mas-cli
|
||||
|
||||
# Build the rest
|
||||
COPY ./Cargo.toml ./Cargo.lock /app/
|
||||
COPY ./crates /app/crates
|
||||
ENV SQLX_OFFLINE=true
|
||||
RUN cargo auditable zigbuild \
|
||||
--locked \
|
||||
--release \
|
||||
--bin mas-cli \
|
||||
--no-default-features \
|
||||
--features docker \
|
||||
--target $(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}")
|
||||
# Network access: cargo auditable needs it
|
||||
RUN --network=default \
|
||||
cargo auditable zigbuild \
|
||||
--locked \
|
||||
--release \
|
||||
--bin mas-cli \
|
||||
--no-default-features \
|
||||
--features docker \
|
||||
--target "$(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}")"
|
||||
|
||||
# Move the binary to avoid having to guess its name in the next stage
|
||||
RUN mv target/$(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}")/release/mas-cli /usr/local/bin/mas-cli
|
||||
RUN --network=none \
|
||||
mv "target/$(/docker-arch-to-rust-target.sh "${TARGETPLATFORM}")/release/mas-cli" /usr/local/bin/mas-cli
|
||||
|
||||
#######################################
|
||||
## Prepare /usr/local/share/mas-cli/ ##
|
||||
|
@ -31,14 +31,14 @@ watchman_client = "0.8.0"
|
||||
tracing = "0.1.37"
|
||||
tracing-appender = "0.2.2"
|
||||
tracing-subscriber = { version = "0.3.16", features = ["env-filter"] }
|
||||
tracing-opentelemetry = "0.18.0"
|
||||
opentelemetry = { version = "0.18.0", features = ["trace", "metrics", "rt-tokio"] }
|
||||
opentelemetry-semantic-conventions = "0.10.0"
|
||||
opentelemetry-jaeger = { version = "0.17.0", features = ["rt-tokio", "collector_client"], optional = true }
|
||||
opentelemetry-otlp = { version = "0.11.0", features = ["trace", "metrics", "http-proto"], optional = true }
|
||||
opentelemetry-zipkin = { version = "0.16.0", features = ["opentelemetry-http"], default-features = false, optional = true }
|
||||
opentelemetry-http = { version = "0.7.0", features = ["tokio", "hyper"], optional = true }
|
||||
opentelemetry-prometheus = { version = "0.11.0", optional = true }
|
||||
tracing-opentelemetry = "0.19.0"
|
||||
opentelemetry = { version = "0.19.0", features = ["trace", "metrics", "rt-tokio"] }
|
||||
opentelemetry-semantic-conventions = "0.11.0"
|
||||
opentelemetry-jaeger = { version = "0.18.0", features = ["rt-tokio", "collector_client"], optional = true }
|
||||
opentelemetry-otlp = { version = "0.12.0", features = ["trace", "metrics"], optional = true }
|
||||
opentelemetry-zipkin = { version = "0.17.0", features = ["opentelemetry-http"], default-features = false, optional = true }
|
||||
opentelemetry-http = { version = "0.8.0", features = ["tokio", "hyper"], optional = true }
|
||||
opentelemetry-prometheus = { version = "0.12.0", optional = true }
|
||||
prometheus = { version = "0.13.3", optional = true }
|
||||
sentry = { version = "0.30.0", default-features = false, features = ["backtrace", "contexts", "panic", "tower"] }
|
||||
sentry-tracing = "0.30.0"
|
||||
|
@ -368,16 +368,13 @@ fn prometheus_meter() -> anyhow::Result<BasicController> {
|
||||
|
||||
#[cfg(feature = "prometheus")]
|
||||
fn prometheus_meter() -> anyhow::Result<BasicController> {
|
||||
let controller = sdk::metrics::controllers::basic(
|
||||
sdk::metrics::processors::factory(
|
||||
// All histogram metrics are in milliseconds. Each bucket is ~2x the previous one.
|
||||
sdk::metrics::selectors::simple::histogram([
|
||||
1.0, 3.0, 5.0, 10.0, 30.0, 50.0, 100.0, 300.0, 1000.0,
|
||||
]),
|
||||
sdk::export::metrics::aggregation::cumulative_temporality_selector(),
|
||||
)
|
||||
.with_memory(true),
|
||||
)
|
||||
let controller = sdk::metrics::controllers::basic(sdk::metrics::processors::factory(
|
||||
// All histogram metrics are in milliseconds. Each bucket is ~2x the previous one.
|
||||
sdk::metrics::selectors::simple::histogram([
|
||||
1.0, 3.0, 5.0, 10.0, 30.0, 50.0, 100.0, 300.0, 1000.0,
|
||||
]),
|
||||
sdk::export::metrics::aggregation::cumulative_temporality_selector(),
|
||||
))
|
||||
.with_resource(resource())
|
||||
.build();
|
||||
|
||||
|
@ -17,7 +17,7 @@ http-body = "0.4.5"
|
||||
hyper = "0.14.26"
|
||||
hyper-rustls = { version = "0.24.0", features = ["http1", "http2"], default-features = false, optional = true }
|
||||
once_cell = "1.17.1"
|
||||
opentelemetry = "0.18.0"
|
||||
opentelemetry = "0.19.0"
|
||||
rustls = { version = "0.21.0", optional = true }
|
||||
rustls-native-certs = { version = "0.6.2", optional = true }
|
||||
serde = "1.0.160"
|
||||
@ -28,7 +28,7 @@ tokio = { version = "1.27.0", features = ["sync", "parking_lot"], optional = tru
|
||||
tower = { version = "0.4.13", features = [] }
|
||||
tower-http = { version = "0.4.0", features = ["cors"] }
|
||||
tracing = "0.1.37"
|
||||
tracing-opentelemetry = "0.18.0"
|
||||
tracing-opentelemetry = "0.19.0"
|
||||
webpki = { version = "0.22.0", optional = true }
|
||||
webpki-roots = { version = "0.23.0", optional = true }
|
||||
|
||||
|
@ -12,12 +12,12 @@ thiserror = "1.0.40"
|
||||
futures-util = "0.3.28"
|
||||
|
||||
apalis-core = { version = "=0.4.0-alpha.5", features = ["tokio-comp"] }
|
||||
opentelemetry = "0.18.0"
|
||||
opentelemetry = "0.19.0"
|
||||
rand_core = "0.6.4"
|
||||
serde = "1.0.160"
|
||||
serde_json = "1.0.96"
|
||||
tracing = "0.1.37"
|
||||
tracing-opentelemetry = "0.18.0"
|
||||
tracing-opentelemetry = "0.19.0"
|
||||
url = "2.3.1"
|
||||
ulid = "1.0.0"
|
||||
|
||||
|
@ -18,8 +18,8 @@ sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "postgres"] }
|
||||
thiserror = "1.0.40"
|
||||
tower = "0.4.13"
|
||||
tracing = "0.1.37"
|
||||
tracing-opentelemetry = "0.18.0"
|
||||
opentelemetry = "0.18.0"
|
||||
tracing-opentelemetry = "0.19.0"
|
||||
opentelemetry = "0.19.0"
|
||||
ulid = "1.0.0"
|
||||
url = "2.3.1"
|
||||
serde = { version = "1.0.160", features = ["derive"] }
|
||||
|
@ -9,11 +9,11 @@ license = "Apache-2.0"
|
||||
aws-smithy-http = { version = "0.55.1", optional = true }
|
||||
http = "0.2.9"
|
||||
tracing = "0.1.37"
|
||||
tracing-opentelemetry = "0.18.0"
|
||||
tracing-opentelemetry = "0.19.0"
|
||||
tower = "0.4.13"
|
||||
tokio = { version = "1.27.0", features = ["time"] }
|
||||
opentelemetry = { version = "0.18.0", features = ["metrics"] }
|
||||
opentelemetry-http = "0.7.0"
|
||||
opentelemetry = { version = "0.19.0", features = ["metrics"] }
|
||||
opentelemetry-http = "0.8.0"
|
||||
pin-project-lite = "0.2.9"
|
||||
|
||||
[features]
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Set to 1 to run OPA through Docker
|
||||
DOCKER := 0
|
||||
OPA_DOCKER_IMAGE := docker.io/openpolicyagent/opa:0.48.0
|
||||
OPA_DOCKER_IMAGE := docker.io/openpolicyagent/opa:0.51.0
|
||||
|
||||
ifeq ($(DOCKER), 0)
|
||||
OPA := opa
|
||||
|
Reference in New Issue
Block a user