Skip to content

Commit 4055efa

Browse files
authored
Merge pull request #38 from bheesham/chore-deps
Upgrade dino-park-*, actix, chrono, config, etc
2 parents c3e9146 + 574f232 commit 4055efa

25 files changed

Lines changed: 1600 additions & 841 deletions

Cargo.lock

Lines changed: 1424 additions & 720 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dino-park-fossil"
3-
version = "0.1.12"
3+
version = "0.1.13"
44
authors = ["Florian Merz <me@fiji-flo.de>"]
55
edition = "2018"
66

@@ -10,22 +10,22 @@ localuserscope = ["dino_park_gate/localuserscope"]
1010
local-fs = ["async-std"]
1111

1212
[dependencies]
13-
cis_client = { git = "https://github.com/mozilla-iam/cis_client-rust", tag = "0.7.2", version = "0.7.2", features = ["sync"] }
14-
cis_profile = { git = "https://github.com/mozilla-iam/cis_profile-rust", tag = "0.4.5", version = "0.4.5", features = ["aws", "vendored"] }
15-
dino_park_gate = { git = "https://github.com/mozilla-iam/dino-park-gate", tag = "0.8.7", version = "0.8.7" }
16-
dino_park_trust = { git = "https://github.com/mozilla-iam/dino-park-trust", tag = "0.0.8", version = "0.0.8" }
17-
dino_park_guard = { git = "https://github.com/mozilla-iam/dino-park-guard", tag = "0.3.5", version = "0.3.5" }
18-
actix-web = "3"
19-
actix-multipart = "0.3"
13+
cis_client = { git = "https://github.com/mozilla-iam/cis_client-rust", tag = "0.9.1", version = "0.9.1", features = ["sync"] }
14+
cis_profile = { git = "https://github.com/mozilla-iam/cis_profile-rust", tag = "0.6.2", version = "0.6.2", features = ["aws", "vendored"] }
15+
dino_park_gate = { git = "https://github.com/mozilla-iam/dino-park-gate", tag = "0.10.8", version = "0.10.8" }
16+
dino_park_trust = { git = "https://github.com/mozilla-iam/dino-park-trust", tag = "0.1.1", version = "0.1.1" }
17+
dino_park_guard = { git = "https://github.com/mozilla-iam/dino-park-guard", tag = "0.5.7", version = "0.5.7" }
18+
actix-web = "4.10.2"
19+
actix-multipart = "0.7"
2020
bytes = "0.5"
2121
futures = "0.3"
2222
log = "0.4"
2323
env_logger = "0.7"
2424
serde = "1.0.80"
2525
serde_json = "1.0.32"
2626
serde_derive = "1.0.80"
27-
chrono = "0.4.6"
28-
config = "0.10"
27+
chrono = "0.4.38"
28+
config = "0.12"
2929
rusoto_core = { version = "0.45", optional = true }
3030
rusoto_s3 = { version = "0.45", optional = true }
3131
image = "0.23"
@@ -40,5 +40,5 @@ lodepng = "3"
4040
byteorder = "1"
4141

4242
[dev-dependencies]
43-
tokio = "0.2"
44-
actix-rt = "1"
43+
tokio = "1"
44+
actix-rt = "2.10.0"

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ FROM rust:latest
22

33
WORKDIR /usr/src/app
44
COPY . .
5-
RUN cargo build --release --target x86_64-unknown-linux-gnu
5+
RUN cargo build --release
66

7-
FROM debian:10-slim
7+
FROM debian:13-slim
88

99
RUN apt-get update && apt-get install -y \
1010
ca-certificates \
1111
&& rm -rf /var/lib/apt/lists/*
1212

1313
WORKDIR /root/
14-
COPY --from=0 /usr/src/app/target/x86_64-unknown-linux-gnu/release/dino-park-fossil .
15-
CMD ["./dino-park-fossil"]
14+
COPY --from=0 /usr/src/app/target/release/dino-park-fossil .
15+
CMD ["./dino-park-fossil"]

Dockerfile.local

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
FROM debian:10-slim
1+
# This is mostly the same as the regular Dockerfile build, except we cache
2+
# locally.
3+
FROM rust:latest
4+
5+
WORKDIR /usr/src/app
6+
COPY . .
7+
RUN --mount=type=cache,target=/usr/src/app/target/release/build \
8+
--mount=type=cache,target=/usr/src/app/target/release/deps \
9+
--mount=type=cache,target=/usr/src/app/target/release/incremental \
10+
--mount=type=cache,target=/usr/local/cargo/registry \
11+
cargo build --release
12+
13+
FROM debian:13-slim
214

315
RUN apt-get update && apt-get install -y \
416
ca-certificates \
517
&& rm -rf /var/lib/apt/lists/*
618

719
WORKDIR /root/
8-
COPY target/release/dino-park-fossil .
20+
COPY --from=0 /usr/src/app/target/release/dino-park-fossil .
921
CMD ["./dino-park-fossil"]

buildspec.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@ phases:
88
commands:
99
- export COMMIT_SHA=$CODEBUILD_RESOLVED_SOURCE_VERSION
1010
- export REV=$COMMIT_SHA
11-
- export CODEBUILD_WEBHOOK_TRIGGER=${CODEBUILD_WEBHOOK_TRIGGER:-branch/master}
11+
- export CODEBUILD_WEBHOOK_TRIGGER=${CODEBUILD_WEBHOOK_TRIGGER:-${MANUAL_DEPLOY_TRIGGER:-branch/master}}
1212
- export DEPLOY_ENV=$(echo $CODEBUILD_WEBHOOK_TRIGGER | sed -e 's/tag\/.*-\(.*\)/\1/' | sed -e 's/branch\/master/dev/')
1313
- export PR=$(if case $CODEBUILD_WEBHOOK_TRIGGER in pr/*) ;; *) false;; esac; then echo 1; fi)
1414
- export MASTER=$(if [ "$CODEBUILD_WEBHOOK_TRIGGER" = "branch/master" ]; then echo 1; fi)
1515
- export CLUSTER=$(if [ "$DEPLOY_ENV" = "dev" ]; then echo "kubernetes-stage-us-west-2"; else echo "kubernetes-prod-us-west-2"; fi)
16+
- export AWS_ACCOUNT_ID="$(aws sts get-caller-identity --query Account --output text)"
17+
- export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:-us-west-2}
1618
- echo "running for ${COMMIT_SHA} in ${DEPLOY_ENV}"
1719
- aws eks update-kubeconfig --name $CLUSTER
18-
- aws ecr get-login --region us-west-2 --no-include-email | bash
20+
- aws ecr get-login-password --region "$AWS_DEFAULT_REGION" | docker login --username AWS --password-stdin "$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com"
1921
- echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
2022
build:
2123
commands:
22-
- if [ "$PR" = 1 ]; then ./do.sh package_local; fi
23-
- if [ "$MASTER" = 1 ]; then ./do.sh package_local && ./do.sh push_image; fi
24+
- if [ "$MASTER" = 1 ]; then ./do.sh docker_build && ./do.sh push_image; fi
2425
post_build:
2526
commands:
2627
- echo "Environment is ${DEPLOY_ENV}"

ci/install_deps.sh

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
export RUSTUP_HOME=/usr/local/rustup
2-
export CARGO_HOME=/usr/local/cargo
3-
export PATH=/usr/local/cargo/bin:$PATH
4-
export RUST_VERSION=1.60.0
51
export DESIRED_VERSION="v3.5.4"
6-
72
set -eux
8-
dpkgArch="$(dpkg --print-architecture)"
9-
case "${dpkgArch##*-}" in
10-
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='49c96f3f74be82f4752b8bffcf81961dea5e6e94ce1ccba94435f12e871c3bdb' ;;
11-
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='5a2be2919319e8778698fa9998002d1ec720efe7cb4f6ee4affb006b5e73f1be' ;;
12-
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='d93ef6f91dab8299f46eef26a56c2d97c66271cea60bf004f2f088a86a697078' ;;
13-
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e3d0ae3cfce5c6941f74fed61ca83e53d4cd2deb431b906cbd0687f246efede4' ;;
14-
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;;
15-
esac;
16-
url="https://static.rust-lang.org/rustup/archive/1.22.1/${rustArch}/rustup-init";
17-
wget --no-verbose "$url"
18-
echo "${rustupSha256} *rustup-init" | sha256sum -c -
19-
chmod +x rustup-init
20-
./rustup-init -y --no-modify-path --default-toolchain $RUST_VERSION
21-
rm rustup-init
22-
chmod -R a+w $RUSTUP_HOME $CARGO_HOME
23-
rustup --version
24-
cargo --version
25-
rustc --version
26-
27-
rustup target add x86_64-unknown-linux-gnu
283
HELM_INSTALL_DIR=/bin
294
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash

dev/docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is used for local development only.
2+
3+
services:
4+
fossil:
5+
image: dino-park-fossil:development
6+
build:
7+
context: ../
8+
dockerfile: Dockerfile.local
9+
environment:
10+
DPF_SETTINGS: /root/.settings.json
11+
volumes:
12+
- ../dev/settings.json:/root/.settings.json
13+
ports:
14+
- 127.0.0.1:8083:8083

dev/settings.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"comment": [
3+
"DEBT: The config parser expects all keys to be defined. It does not use",
4+
"the fallback to using the default values on `None`. This comment section",
5+
"is also a hack.",
6+
"See also:",
7+
"* src/settings.rs;",
8+
"* the `config` dependency."
9+
],
10+
"auth": "https://dev.mozilla-dev.auth0.com",
11+
"cis": {
12+
"client_config": {
13+
"client_id": "",
14+
"client_secret": "",
15+
"audience": "",
16+
"token_endpoint": "https://idp",
17+
"scopes": ""
18+
},
19+
"sign_keys": {
20+
"source": "none"
21+
},
22+
"verify_keys": {
23+
"source": "none"
24+
},
25+
"person_api_user_endpoint": "https://person-api.cis",
26+
"person_api_users_endpoint": "https://person-api.cis",
27+
"change_api_user_endpoint": "https://change-api.cis",
28+
"change_api_users_endpoint": "https://change-api.cis"
29+
},
30+
"avatar": {
31+
"s3_bucket": "cis-testing-avatars",
32+
"retrieve_by_id_path": "/avatar/get/id/",
33+
"picture_api_url": "https://picture.api.dev.sso.allizom.org"
34+
}
35+
}

do.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@ NAME=dino-park-fossil
66
DOCKER_REGISTRY=320464205386.dkr.ecr.us-west-2.amazonaws.com
77
REV=${REV:-latest}
88

9-
compile_release() {
10-
cargo build --release
11-
}
12-
13-
docker_build_local() {
14-
docker build -t ${DOCKER_REGISTRY}/${NAME}:${REV} -f Dockerfile.local .
15-
}
16-
179
docker_build() {
1810
docker build -t ${DOCKER_REGISTRY}/${NAME}:${REV} -f Dockerfile .
1911
}
2012

21-
package_local() {
22-
compile_release
23-
docker_build_local
24-
}
25-
2613
push_image() {
2714
docker push ${DOCKER_REGISTRY}/${NAME}:${REV}
2815
}

src/error.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// DEBT: Quoting the lint:
2+
// non-local `impl` definition, `impl` blocks should be written at the same
3+
// level as their item
4+
#![allow(non_local_definitions)]
5+
16
use actix_web::error::ResponseError;
27
use actix_web::HttpResponse;
38
use dino_park_trust::GroupsTrustError;

0 commit comments

Comments
 (0)