From b7fd9aa8d1bde20e39f0afc7d280978ea120e357 Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 7 Aug 2022 16:00:48 -0700 Subject: [PATCH] x86_64-unknown-linux-musl compatibility and volume mount --- Cargo.lock | 10 ++++++++++ crates/service/storyteller_web/Cargo.toml | 2 +- localdev/Dockerfile | 22 ++++++---------------- localdev/kubernetes.yml | 8 +++++++- localdev/startup.sh | 2 +- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1325b96c73..438c6a6ddd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3220,6 +3220,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +[[package]] +name = "openssl-src" +version = "111.22.0+1.1.1q" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f31f0d509d1c1ae9cada2f9539ff8f37933831fd5098879e482aa687d659853" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.76" @@ -3229,6 +3238,7 @@ dependencies = [ "autocfg 1.0.1", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/crates/service/storyteller_web/Cargo.toml b/crates/service/storyteller_web/Cargo.toml index ce619bada3..5cc9db3bf3 100644 --- a/crates/service/storyteller_web/Cargo.toml +++ b/crates/service/storyteller_web/Cargo.toml @@ -71,7 +71,7 @@ language-tags = "0.3.2" # Parsing single tags richly # HTTP # TODO/NB: This is just for Twitch, but we might need it later. reqwest = { version = "0.11.4" } -native-tls = "0.2.8" +native-tls = { version = "0.2.8", features = ["vendored"] } # Runtime # NB: We switched to Tokio from `async-std` for broader ecosystem support. diff --git a/localdev/Dockerfile b/localdev/Dockerfile index 0944a08fc0..c070e24f1c 100644 --- a/localdev/Dockerfile +++ b/localdev/Dockerfile @@ -1,33 +1,23 @@ -FROM ubuntu:20.04 +FROM rust:latest ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y \ - mysql-client \ + mariadb-client \ imagemagick \ - libmysqlclient-dev \ + libmariadb-dev \ && rm -rf /var/lib/apt/lists/* -FROM rust:latest RUN cargo install diesel_cli --features mysql && \ cargo install sqlx-cli --features mysql WORKDIR /storyteller-rust -COPY Cargo.lock . -COPY Cargo.toml . -COPY sqlx-data.json . -COPY crates/ ./crates -COPY db/ ./db -COPY _migrations ./migrations +ARG GIT_SHA -WORKDIR /storyteller-rust +RUN echo -n ${GIT_SHA} > /GIT_SHA -RUN cargo build --release --bin storyteller-web --bin tts-download-job --bin w2l-download-job --bin tts-inference-job --bin w2l-inference-job --bin websocket-gateway --bin twitch-pubsub-subscriber - -COPY localdev/startup.sh ./startup.sh - -CMD ["./startup.sh"] +CMD ["/storyteller-rust/localdev/startup.sh"] diff --git a/localdev/kubernetes.yml b/localdev/kubernetes.yml index 1ad10d6640..b4076c5c3a 100644 --- a/localdev/kubernetes.yml +++ b/localdev/kubernetes.yml @@ -98,7 +98,13 @@ spec: value: garbage ports: - containerPort: 12345 - + volumeMounts: + - mountPath: /storyteller-rust + name: storyteller-rust-folder + volumes: + - name: storyteller-rust-folder + hostPath: + path: /storyteller-rust --- apiVersion: v1 diff --git a/localdev/startup.sh b/localdev/startup.sh index 7947e18a49..295bfde3f3 100755 --- a/localdev/startup.sh +++ b/localdev/startup.sh @@ -1,4 +1,4 @@ #!/bin/sh diesel migration run --database-url="${MYSQL_URL}" -cargo run --release --bin storyteller-web +./target/x86_64-unknown-linux-musl/release/storyteller-web