Skip to content

Commit c07ced5

Browse files
authored
Merge pull request #38 from bheesham/chore-deps
Upgrade dino-park-related crates, etc, etc
2 parents c4d1eb6 + f43f90d commit c07ced5

16 files changed

Lines changed: 1123 additions & 1096 deletions

Cargo.lock

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

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ authors = ["Florian Merz <flomerz@gmail.com>"]
55
edition = "2018"
66

77
[dependencies]
8-
cis_client = { git = "https://github.com/mozilla-iam/cis_client-rust", tag = "0.7.2", version = "0.7.2", features = ["sync"] }
9-
cis_profile = { git = "https://github.com/mozilla-iam/cis_profile-rust", tag = "0.4.5", version = "0.4.5", features = ["aws", "vendored"] }
10-
dino_park_gate = { git = "https://github.com/mozilla-iam/dino-park-gate", tag = "0.8.7", version = "0.8.7" }
11-
actix-web = "3"
12-
actix-rt = "1"
8+
cis_client = { git = "https://github.com/mozilla-iam/cis_client-rust", tag = "0.9.1", version = "0.9.1", features = ["sync"] }
9+
cis_profile = { git = "https://github.com/mozilla-iam/cis_profile-rust", tag = "0.6.2", version = "0.6.2", features = ["aws", "vendored"] }
10+
dino_park_gate = { git = "https://github.com/mozilla-iam/dino-park-gate", tag = "0.10.8", version = "0.10.8" }
11+
actix-web = "4.10.2"
12+
actix-rt = "2.10.0"
1313
futures = "0.3"
1414
log = "0.4"
1515
env_logger = "0.7"
1616
serde = "1.0.80"
1717
serde_json = "1.0.32"
1818
serde_derive = "1.0.80"
19-
reqwest = { version = "0.10", features = ["json"] }
20-
chrono = "0.4"
21-
config = "0.10"
19+
reqwest = { version = "0.11", features = ["json", "multipart"] }
20+
chrono = "0.4.38"
21+
config = "0.12"
2222
failure = "0.1"
2323
failure_derive = "0.1"
24-
biscuit = "0.4"
24+
biscuit = "0.5"
2525
url = "2.1"
26-
tokio = "0.2"
26+
tokio = "1"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /usr/src/app
44
COPY . .
55
RUN cargo build --release
66

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

99
RUN apt-get update && apt-get install -y \
1010
ca-certificates \

Dockerfile.local

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
FROM debian:11-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-lookout .
20+
COPY --from=0 /usr/src/app/target/release/dino-park-lookout .
921
CMD ["./dino-park-lookout"]

buildspec.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ phases:
44
install:
55
commands:
66
- ". ci/install_deps.sh"
7-
- echo "${DOCKERHUB_PASSWORD}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
87
pre_build:
98
commands:
109
- export COMMIT_SHA=$CODEBUILD_RESOLVED_SOURCE_VERSION
1110
- export REV=$COMMIT_SHA
12-
- export CODEBUILD_WEBHOOK_TRIGGER=${CODEBUILD_WEBHOOK_TRIGGER:-branch/master}
11+
- export CODEBUILD_WEBHOOK_TRIGGER=${CODEBUILD_WEBHOOK_TRIGGER:-${MANUAL_DEPLOY_TRIGGER:-branch/master}}
1312
- export DEPLOY_ENV=$(echo $CODEBUILD_WEBHOOK_TRIGGER | sed -e 's/tag\/.*-\(.*\)/\1/' | sed -e 's/branch\/master/dev/')
1413
- export PR=$(if case $CODEBUILD_WEBHOOK_TRIGGER in pr/*) ;; *) false;; esac; then echo 1; fi)
1514
- export MASTER=$(if [ "$CODEBUILD_WEBHOOK_TRIGGER" = "branch/master" ]; then echo 1; fi)
1615
- 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}
1718
- echo "running for ${COMMIT_SHA} in ${DEPLOY_ENV}"
1819
- aws eks update-kubeconfig --name $CLUSTER
19-
- 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"
2021
- echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
2122
build:
2223
commands:
23-
- if [ "$PR" = 1 ]; then ./do.sh package_local; fi
24-
- 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
2525
post_build:
2626
commands:
2727
- 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+
lookout:
5+
image: dino-park-lookout:development
6+
build:
7+
context: ../
8+
dockerfile: Dockerfile.local
9+
environment:
10+
DPL_SETTINGS: /root/.settings.json
11+
volumes:
12+
- ../dev/settings.json:/root/.settings.json
13+
ports:
14+
- 127.0.0.1:8082:8082

dev/settings.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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": {
11+
"issuer": "https://dev.mozilla-dev.auth0.com/",
12+
"validation": {
13+
"audience": "hook.dev.sso.allizom.org"
14+
}
15+
},
16+
"cis": {
17+
"client_config": {
18+
"client_id": "",
19+
"client_secret": "",
20+
"audience": "",
21+
"token_endpoint": "https://idp",
22+
"scopes": ""
23+
},
24+
"sign_keys": {
25+
"source": "none"
26+
},
27+
"verify_keys": {
28+
"source": "none"
29+
},
30+
"person_api_user_endpoint": "https://person-api.cis",
31+
"person_api_users_endpoint": "https://person-api.cis",
32+
"change_api_user_endpoint": "https://change-api.cis",
33+
"change_api_users_endpoint": "https://change-api.cis"
34+
},
35+
"dino_park": {
36+
"groups_bulk_endpoint": "http://packs/internal/update/bulk",
37+
"groups_delete_endpoint": "http://packs/internal/delete",
38+
"groups_update_endpoint": "http://packs/internal/update/user",
39+
"orgchart_bulk_endpoint": "http://tree/orgchart/bulk",
40+
"orgchart_delete_endpoint": "http://tree/orgchart/delete",
41+
"orgchart_update_endpoint": "http://tree/orgchart/update",
42+
"picture_delete_endpoint": "http://fossil/internal/delete",
43+
"search_bulk_endpoint": "http://search/search/bulk",
44+
"search_delete_endpoint": "http://search/search/delete",
45+
"search_update_endpoint": "http://search/search/update",
46+
"uuid_by_user_id_endpoint": "http://search/search/uuid"
47+
}
48+
}

do.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,10 @@ NAME=dino-park-lookout
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 reqwest::Error;
27

38
#[derive(Debug, Fail)]

0 commit comments

Comments
 (0)