Skip to content

Commit

Permalink
KF-4011 install necessary libs (#10)
Browse files Browse the repository at this point in the history
* Add mysql necessary libs
* Fix rockcraft
  • Loading branch information
misohu authored Jul 28, 2023
1 parent 8826085 commit da07a72
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 20 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ RUN set -eux; \
DEBIAN_FRONTEND=noninteractive apt-get remove --purge --auto-remove -y; \
rm -rf /var/lib/apt/lists/*; \
# install mlflow
pip install --no-cache mlflow==$VERSION; \
# install boto3
pip install --no-cache boto3; \
# install prometheus exporter
pip install --no-cache prometheus-flask-exporter
pip install --no-cache mlflow==$VERSION

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt --no-cache

# to stay consistent with upstream image we separate the dpkg-query to separate layer
RUN mkdir -p /usr/share/rocks; \
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
boto3
prometheus-flask-exporter
pymysql
cryptography
23 changes: 8 additions & 15 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,26 @@ description: |
version: "v2.1.1_22.04_1"
license: Apache-2.0
base: ubuntu:22.04
build-base: ubuntu:22.04
base: bare
platforms:
amd64:
run-user: _daemon_

services:
mlflow-server:
override: replace
command: /usr/bin/python3
startup: enabled
user: ubuntu

parts:
security-team-requirement:
plugin: nil
override-build: |
mkdir -p ${CRAFT_PART_INSTALL}/usr/share/rocks
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && \
dpkg-query --root=${CRAFT_PROJECT_DIR}/../bundles/ubuntu-22.04/rootfs/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) \
> ${CRAFT_PART_INSTALL}/usr/share/rocks/dpkg.query
mlflow:
source: .
Expand All @@ -36,15 +39,5 @@ parts:
- tzdata
python-packages:
- mlflow==2.1.1
- boto3
- prometheus-flask-exporter

non-root-user:
plugin: nil
after: [mlflow]
overlay-script: |
# Create a user in the $CRAFT_OVERLAY chroot
groupadd -R $CRAFT_OVERLAY -g 1001 ubuntu
useradd -R $CRAFT_OVERLAY -M -r -u 1001 -g ubuntu ubuntu
override-prime: |
craftctl default
python-requirements:
- requirements.txt

0 comments on commit da07a72

Please sign in to comment.