Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update the Dockerfiles to build more cleanly #171

Merged
merged 3 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.git/
contrib/
target/
.github/
venv/
.github/
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
FROM rust:1.67 AS builder
FROM rust:1.75 AS builder

RUN mkdir /build
WORKDIR /build

COPY ./ .

RUN cargo build --release
RUN cargo build --release --features s3

FROM ubuntu
FROM alpine

RUN apt-get update
RUN apt-get install -y ca-certificates
RUN apk add -U ca-certificates

WORKDIR /build

COPY --from=builder /build/target/release/kafka-delta-ingest ./
ENTRYPOINT ["/build/kafka-delta-ingest"]
ENTRYPOINT ["/build/kafka-delta-ingest"]
17 changes: 0 additions & 17 deletions Dockerfile.Debian

This file was deleted.

22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.DEFAULT_GOAL := help

CARGO:=$(shell which cargo)
APP=target/debug/placementd-web
SOURCES=$(shell find . -type f -iname '*.rs')

$(APP): Cargo.toml $(SOURCES)
$(CARGO) build

.PHONY: check
check: Cargo.toml $(SOURCES)
$(CARGO) fmt
$(CARGO) test --features azure,s3

.PHONY: docker
docker: Dockerfile ## Build the docker image
docker build -t kafka-delta-ingest .


.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2 changes: 1 addition & 1 deletion Dockerfile.setup → contrib/Dockerfile.setup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:alpine
FROM python:3-alpine3.18

RUN apk add --no-cache aws-cli bash openssh ca-certificates jq curl openssl perl git zip \
&& apk add --no-cache --virtual .build-deps gcc make openssl-dev libffi-dev musl-dev linux-headers \
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ services:
setup:
build:
context: .
dockerfile: Dockerfile.setup
dockerfile: contrib/Dockerfile.setup
depends_on:
- kafka
- localstack
Expand Down
5 changes: 0 additions & 5 deletions src/coercions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ pub(crate) struct CoercionTree {
root: HashMap<String, CoercionNode>,
}

#[derive(Debug, Clone, PartialEq)]
pub(crate) struct CoercionArray {
element: CoercionNode,
}

/// Returns a [`CoercionTree`] so the schema can be walked efficiently level by level when performing conversions.
pub(crate) fn create_coercion_tree(schema: &DeltaSchema) -> CoercionTree {
let mut root = HashMap::new();
Expand Down
2 changes: 1 addition & 1 deletion src/dead_letters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl DeltaSinkDeadLetterQueue {
dynamo_lock_options::DYNAMO_LOCK_PARTITION_KEY_VALUE.to_string() => std::env::var(env_vars::DEAD_LETTER_DYNAMO_LOCK_PARTITION_KEY_VALUE)
.unwrap_or_else(|_| "kafka_delta_ingest-dead_letters".to_string()),
};
#[cfg(feature = "azure")]
#[cfg(all(feature = "azure", not(feature = "s3")))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see this. I am glad for it. I have it in a branch somewhere I haven't pushed back.

let opts = HashMap::default();

let table = crate::delta_helpers::load_table(table_uri, opts.clone()).await?;
Expand Down
Loading