-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from symflower/revert-234-docker-runtime-foll…
…ow-up Revert "Docker runtime follow up"
- Loading branch information
Showing
7 changed files
with
48 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,40 @@ | ||
# Builder image. | ||
FROM golang:latest as builder | ||
|
||
WORKDIR /app | ||
COPY ./ ./ | ||
|
||
# Build the binary. | ||
RUN go mod tidy | ||
RUN CGO_ENABLED=0 go build -o eval-dev-quality ./cmd/eval-dev-quality | ||
|
||
# Actual running image. | ||
FROM ubuntu:noble | ||
RUN apt-get update && apt-get install -y ca-certificates wget unzip git make && update-ca-certificates | ||
|
||
# Non-root ollama need a hardcoded directory to store ssh-key. | ||
RUN mkdir -p /.ollama && chmod 777 /.ollama | ||
# Same for symflower | ||
RUN mkdir -p /.config && chmod 777 /.config | ||
RUN mkdir -p /.eval-dev-quality && chmod 777 /.eval-dev-quality | ||
RUN mkdir -p /.cache && chmod 777 /.cache | ||
WORKDIR /home/ubuntu/eval-dev-quality | ||
COPY ./ ./ | ||
RUN chown -R ubuntu:ubuntu ./ | ||
|
||
# Switch to the ubuntu user as we want it to run as non-root. | ||
USER ubuntu | ||
WORKDIR /app | ||
COPY --chown=ubuntu:ubuntu ./testdata ./testdata | ||
COPY --chown=ubuntu:ubuntu ./Makefile ./Makefile | ||
RUN mkdir -p .eval-dev-quality | ||
RUN mkdir -p ~/.eval-dev-quality | ||
|
||
# Install Maven | ||
RUN wget https://archive.apache.org/dist/maven/maven-3/3.9.1/binaries/apache-maven-3.9.1-bin.tar.gz && \ | ||
tar -xf apache-maven-3.9.1-bin.tar.gz -C /app/.eval-dev-quality/ && \ | ||
tar -xf apache-maven-3.9.1-bin.tar.gz -C ~/.eval-dev-quality/ && \ | ||
rm apache-maven-3.9.1-bin.tar.gz | ||
ENV PATH="${PATH}:/app/.eval-dev-quality/apache-maven-3.9.1/bin" | ||
ENV PATH="${PATH}:/home/ubuntu/.eval-dev-quality/apache-maven-3.9.1/bin" | ||
|
||
# Install Gradle | ||
RUN wget https://services.gradle.org/distributions/gradle-8.0.2-bin.zip && \ | ||
unzip gradle-8.0.2-bin.zip -d /app/.eval-dev-quality/ && \ | ||
unzip gradle-8.0.2-bin.zip -d ~/.eval-dev-quality/ && \ | ||
rm gradle-8.0.2-bin.zip | ||
ENV PATH="${PATH}:/app/.eval-dev-quality/gradle-8.0.2/bin" | ||
ENV PATH="${PATH}:/home/ubuntu/.eval-dev-quality/gradle-8.0.2/bin" | ||
|
||
# Install Java | ||
RUN wget https://corretto.aws/downloads/latest/amazon-corretto-11-x64-linux-jdk.tar.gz && \ | ||
tar -xf amazon-corretto-11-x64-linux-jdk.tar.gz -C /app/.eval-dev-quality/ && \ | ||
tar -xf amazon-corretto-11-x64-linux-jdk.tar.gz -C ~/.eval-dev-quality/ && \ | ||
rm amazon-corretto-11-x64-linux-jdk.tar.gz | ||
ENV JAVA_HOME="/app/.eval-dev-quality/amazon-corretto-11.0.23.9.1-linux-x64" | ||
ENV JAVA_HOME="/home/ubuntu/.eval-dev-quality/amazon-corretto-11.0.23.9.1-linux-x64" | ||
ENV PATH="${PATH}:${JAVA_HOME}/bin" | ||
|
||
# Install Go | ||
RUN wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz && \ | ||
tar -xf go1.21.5.linux-amd64.tar.gz -C /app/.eval-dev-quality/ && \ | ||
tar -xf go1.21.5.linux-amd64.tar.gz -C ~/.eval-dev-quality/ && \ | ||
rm go1.21.5.linux-amd64.tar.gz | ||
ENV PATH="${PATH}:/app/.eval-dev-quality/go/bin" | ||
RUN go env -w GOPATH=/app/.eval-dev-quality/go | ||
ENV PATH="${PATH}:/home/ubuntu/.eval-dev-quality/go/bin" | ||
ENV PATH="${PATH}:/home/ubuntu/go/bin" | ||
|
||
# Install the binary | ||
COPY --from=builder --chown=ubuntu:ubuntu /app/eval-dev-quality /app/.eval-dev-quality/bin/ | ||
ENV PATH="${PATH}:/app/.eval-dev-quality/bin" | ||
RUN make install-tools-testing | ||
RUN make install-tools /app/.eval-dev-quality/bin | ||
# Setup the evaluation | ||
|
||
# CHMOD everything because of non-root user ids | ||
RUN chmod -R 777 /app | ||
RUN make install-all | ||
ENV PATH="${PATH}:/home/ubuntu/.eval-dev-quality/bin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
export ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) | ||
|
||
export PACKAGE_BASE := github.com/symflower/eval-dev-quality | ||
export UNIT_TEST_TIMEOUT := 720 | ||
export UNIT_TEST_TIMEOUT := 480 | ||
|
||
ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) | ||
$(eval $(ARGS):;@:) # turn arguments into do-nothing targets | ||
|
@@ -44,16 +44,13 @@ install: # [<Go package] - # Build and install everything, or only the specified | |
go install -v $(PACKAGE) | ||
.PHONY: install | ||
|
||
install-all: install install-tools install-tools-testing # Install everything for and of this repository. | ||
install-all: install install-tools-testing # Install everything for and of this repository. | ||
.PHONY: install-all | ||
|
||
install-tools: # Install tools that are required for running the evaluation. | ||
eval-dev-quality install-tools $(if $(ARGS), --install-tools-path $(word 1,$(ARGS))) | ||
.PHONY: install-tools | ||
|
||
install-tools-testing: # Install tools that are used for testing. | ||
go install -v github.com/vektra/mockery/[email protected] | ||
go install -v gotest.tools/[email protected] | ||
eval-dev-quality install-tools | ||
.PHONY: install-tools-testing | ||
|
||
generate: # Run code generation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.