-
Notifications
You must be signed in to change notification settings - Fork 30
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
[agentrunner] Split the docker image and clean up the logs #404
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
|
||
Copyright DataStax, Inc. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>langstream-runtime</artifactId> | ||
<groupId>ai.langstream</groupId> | ||
<version>0.0.17-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>langstream-runtime-base-docker-image</artifactId> | ||
|
||
<properties> | ||
<docker.platforms>linux/amd64</docker.platforms> | ||
<skipPythonPackage>false</skipPythonPackage> | ||
</properties> | ||
|
||
<profiles> | ||
|
||
<profile> | ||
<id>docker</id> | ||
<activation> | ||
<property> | ||
<name>docker</name> | ||
</property> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>docker-maven-plugin</artifactId> | ||
<configuration> | ||
<verbose>true</verbose> | ||
<images> | ||
<image> | ||
<name>langstream/langstream-runtime-base:latest-dev</name> | ||
<build> | ||
<dockerFile>${project.basedir}/src/main/docker/Dockerfile</dockerFile> | ||
<buildx> | ||
<platforms> | ||
<platform>${docker.platforms}</platform> | ||
</platforms> | ||
</buildx> | ||
</build> | ||
</image> | ||
</images> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# | ||
# | ||
# Copyright DataStax, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
FROM ubuntu:22.04 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install some utilities | ||
RUN echo 'Acquire::http::Timeout "30";\nAcquire::ftp::Timeout "30";\nAcquire::Retries "3";' > /etc/apt/apt.conf.d/99timeout_and_retries \ | ||
&& apt-get update \ | ||
&& apt-get -y dist-upgrade \ | ||
&& apt-get -y install --no-install-recommends vim netcat dnsutils less procps net-tools iputils-ping unzip \ | ||
curl ca-certificates wget apt-transport-https software-properties-common gpg-agent | ||
|
||
# Install Python3.11 | ||
RUN apt-get update && add-apt-repository ppa:deadsnakes/ppa \ | ||
&& apt-get -y install --no-install-recommends python3.11-full \ | ||
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \ | ||
&& python3 -m ensurepip && python3 -m pip install pipenv | ||
|
||
|
||
# Install Eclipse Temurin Package | ||
RUN mkdir -p /etc/apt/keyrings \ | ||
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc \ | ||
&& echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \ | ||
&& apt-get update \ | ||
&& apt-get -y dist-upgrade \ | ||
&& apt-get -y install temurin-17-jdk \ | ||
&& export ARCH=$(uname -m | sed -r 's/aarch64/arm64/g' | awk '!/arm64/{$0="amd64"}1') \ | ||
&& echo networkaddress.cache.ttl=1 >> /usr/lib/jvm/temurin-17-jdk-$ARCH/conf/security/java.security | ||
|
||
# Cleanup apt | ||
RUN apt-get -y --purge autoremove \ | ||
&& apt-get autoclean \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/LangStream/langstream | ||
LABEL org.opencontainers.image.licenses=Apache-2.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,41 +15,10 @@ | |
# limitations under the License. | ||
# | ||
|
||
FROM ubuntu:22.04 | ||
FROM langstream/langstream-runtime-base:latest-dev | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install some utilities | ||
RUN echo 'Acquire::http::Timeout "30";\nAcquire::ftp::Timeout "30";\nAcquire::Retries "3";' > /etc/apt/apt.conf.d/99timeout_and_retries \ | ||
&& apt-get update \ | ||
&& apt-get -y dist-upgrade \ | ||
&& apt-get -y install --no-install-recommends vim netcat dnsutils less procps net-tools iputils-ping \ | ||
curl ca-certificates wget apt-transport-https software-properties-common gpg-agent | ||
|
||
# Install Python3.11 | ||
RUN apt-get update && add-apt-repository ppa:deadsnakes/ppa \ | ||
&& apt-get -y install --no-install-recommends python3.11-full \ | ||
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \ | ||
&& python3 -m ensurepip && python3 -m pip install pipenv | ||
|
||
|
||
# Install Eclipse Temurin Package | ||
RUN mkdir -p /etc/apt/keyrings \ | ||
&& wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc \ | ||
&& echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list \ | ||
&& apt-get update \ | ||
&& apt-get -y dist-upgrade \ | ||
&& apt-get -y install temurin-17-jdk \ | ||
&& export ARCH=$(uname -m | sed -r 's/aarch64/arm64/g' | awk '!/arm64/{$0="amd64"}1') \ | ||
&& echo networkaddress.cache.ttl=1 >> /usr/lib/jvm/temurin-17-jdk-$ARCH/conf/security/java.security | ||
|
||
# Cleanup apt | ||
RUN apt-get -y install unzip \ | ||
&& apt-get -y --purge autoremove \ | ||
&& apt-get autoclean \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir /app && chmod g+w /app | ||
|
||
ADD maven/Pipfile.lock /app/Pipfile.lock | ||
|
@@ -58,8 +27,8 @@ ENV NLTK_DATA="/app/nltk_data" | |
|
||
# Install python runtime deps | ||
RUN cd /app && pipenv requirements --categories="packages full" > /app/requirements.txt \ | ||
&& python3 -m pip install -r /app/requirements.txt \ | ||
&& python3 -m nltk.downloader -d /app/nltk_data punkt averaged_perceptron_tagger | ||
&& python3 -m pip install -r /app/requirements.txt \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this stuff takes a lot and it's likely to never change during development, can we put it in the base image ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but we cannot do it because of this line, that depends on the langstream-runtime build (the "maven" directory) ADD maven/Pipfile.lock /app/Pipfile.lock cc @cbornet There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should isolate the python stuff in it’s own maven subproject. |
||
&& python3 -m nltk.downloader -d /app/nltk_data punkt averaged_perceptron_tagger | ||
|
||
ENV PYTHONPATH="$PYTHONPATH:/app/python_libs" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is commented code