Skip to content

Commit

Permalink
Minimize compiled dependency files (#3653)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchu authored Jun 24, 2024
1 parent 7a6e992 commit ae60d18
Show file tree
Hide file tree
Showing 28 changed files with 98 additions and 2,301 deletions.
13 changes: 3 additions & 10 deletions .ci/Dockerfile → .ci/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#########################################################
## Python Environment with CUDA
#########################################################
ARG ver_cuda="11.7.1"

FROM nvidia/cuda:${ver_cuda}-devel-ubuntu20.04@sha256:f663a1cf01a46daa469c75bf246ac00098bd5179aff2c75367c44f475cd4c8f4 AS python_base_cuda
FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04@sha256:c1869c30f46fff478a37ed58d9dace7e08519541274f03424d0b78bd35b2c73a AS python_base_cuda
LABEL maintainer="OpenVINO Training Extensions Development Team"

ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ARG action_runner_url
ARG uid
ARG gid

Expand All @@ -19,21 +17,16 @@ ENV https_proxy=$HTTPS_PROXY
ENV no_proxy=$NO_PROXY
ENV DEBIAN_FRONTEND="noninteractive"

# added ninja-build for using CppExtension in the torch
# hadolint ignore=DL3008
RUN apt-get update && apt-get install --no-install-recommends -y \
software-properties-common \
wget \
ffmpeg \
libpython3.10 \
curl \
nodejs \
unzip \
npm \
ruby-dev \
git \
cron \
ninja-build \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -58,9 +51,9 @@ FROM python_base_cuda as otx_development_env

RUN mkdir actions-runner
WORKDIR /home/validation/actions-runner
ARG action_runner_url
ARG ACTIONS_RUNNER_VER=2.317.0
# download actions-runner and extract it
RUN curl -o actions-runner-linux-x64.tar.gz -L ${action_runner_url} && \
RUN curl -o actions-runner-linux-x64.tar.gz -L https://github.com/actions/runner/releases/download/v${ACTIONS_RUNNER_VER}/actions-runner-linux-x64-${ACTIONS_RUNNER_VER}.tar.gz && \
tar xzf ./actions-runner-linux-x64.tar.gz && \
rm actions-runner-linux-x64.tar.gz

Expand Down
19 changes: 9 additions & 10 deletions .ci/README.md → .ci/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
# Guide to Setting up the CI using the Docker images

1. Build the docker image using the `build.sh` in the .ci directory.
Make sure you are in the root directory of `training_extensions`.
Make sure you are in the `.ci/docker` directory of `training_extensions`.

```bash
training_extensions$ .ci/build.sh --help
USAGE: .ci/build.sh <tag> [Options]
training_extensions/.ci/docker$ ./build.sh --help
USAGE: .ci/docker/build.sh <tag> [Options]
Positional args
<tag> Tag name to be tagged to newly built image
Options
-p|--push Push built image(s) to registry
-u|--url url to get Github actions-runner package
-c|--cuda Specify CUDA version
-r|--reg Specify docker registry URL <default: local>
-h|--help Print this message
```

Below example builds an image using actions-runner v2.305.0 based on `NVIDIA CUDA 11.7.1` image and tag it as `2.305.0`.
Below example builds an image using actions-runner v2.317.0 based on NVIDIA cuda image and tag it as `2.317.0`.

```bash
training_extensions$ .ci/build.sh 2.305.0 -u https://github.com/actions/runner/releases/download/v2.305.0/actions-runner-linux-x64-2.305.0.tar.gz -c 11.7.1
training_extensions$ .ci/build.sh 2.317.0 -u https://github.com/actions/runner/releases/download/v2.305.0/actions-runner-linux-x64-2.305.0.tar.gz
```

> **_Note_**: While building an image, script will use your system's environment variables `http_proxy`, `https_proxy`, and `no_proxy`. If you need to use proxy to access external entity, please check those settings before using this script.
Expand All @@ -35,8 +34,8 @@
1. Create a container and start runner

```bash
training_extensions$ .ci/start-runner.sh --help
USAGE: $0 <container-prefix> <github-token> [Options]
training_extensions$ .ci/docker/start-runner.sh --help
USAGE: .ci/docker/start-runner.sh <container-prefix> <github-token> [Options]
Positional args
<container-prefix> Prefix to the ci container and actions-runner
<github-token> Github token string
Expand Down Expand Up @@ -78,8 +77,8 @@
1. Stop the runner and running container

```bash
training_extensions$ .ci/stop-runner.sh
USAGE: .ci/stop-runner.sh <container-name> <github-token> [Options]
training_extensions$ .ci/docker/stop-runner.sh
USAGE: .ci/docker/stop-runner.sh <container-name> <github-token> [Options]
Options
-h|--help Print this message
```
Expand Down
21 changes: 7 additions & 14 deletions .ci/build.sh → .ci/docker/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

VER_CUDA="11.7.1"
ACTIONS_RUNNER_URL="https://github.com/actions/runner/releases/download/v2.305.0/actions-runner-linux-x64-2.305.0.tar.gz"
VER_CUDA="12.1.0"
ACTIONS_RUNNER_VER="2.317.0"
DOCKER_REG_ADDR="local"
POSITIONAL=()
while [[ $# -gt 0 ]]; do
Expand All @@ -12,13 +12,8 @@ while [[ $# -gt 0 ]]; do
PUSH="yes"
shift # past argument
;;
-u|--url)
ACTIONS_RUNNER_URL="$2"
shift # past argument
shift # past value
;;
-c|--cuda)
VER_CUDA="$2"
-v|--version)
ACTIONS_RUNNER_VER="$2"
shift # past argument
shift # past value
;;
Expand Down Expand Up @@ -48,8 +43,7 @@ cat << EndofMessage
<tag> Tag name to be tagged to newly built image
Options
-p|--push Push built image(s) to registry
-u|--url url to get Github actions-runner package
-c|--cuda Specify CUDA version
-v|--version Specify actions-runner version
-r|--reg Specify docker registry URL <default: local>
-h|--help Print this message
EndofMessage
Expand All @@ -58,12 +52,11 @@ fi

TAG=$1

docker build -f .ci/Dockerfile \
docker build -f ./Dockerfile \
--build-arg HTTP_PROXY="${http_proxy:?}" \
--build-arg HTTPS_PROXY="${https_proxy:?}" \
--build-arg NO_PROXY="${no_proxy:?}" \
--build-arg ver_cuda="$VER_CUDA" \
--build-arg action_runner_url="$ACTIONS_RUNNER_URL" \
--build-arg ACTIONS_RUNNER_VER="$ACTIONS_RUNNER_VER" \
--build-arg gid="$(id -g)" \
--build-arg uid="$UID" \
--tag "$DOCKER_REG_ADDR"/ote/ci/cu"$VER_CUDA"/runner:"$TAG" \
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --generate-hashes --output-file=./piptools/requirements.txt ./piptools/requirements.in
# pip-compile --generate-hashes --output-file=.ci/requirements.txt .ci/requirements.in
#
build==1.2.1 \
--hash=sha256:526263f4870c26f26c433545579475377b2b7588b6f1eac76a001e873ae3e19d \
Expand All @@ -12,14 +12,14 @@ click==8.1.7 \
--hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \
--hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de
# via pip-tools
packaging==24.0 \
--hash=sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5 \
--hash=sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9
packaging==24.1 \
--hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \
--hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124
# via build
pip-tools==7.4.1 \
--hash=sha256:4c690e5fbae2f21e87843e89c26191f0d9454f362d8acdbd695716493ec8b3a9 \
--hash=sha256:864826f5073864450e24dbeeb85ce3920cdfb09848a3d69ebf537b521f14bcc9
# via -r ./piptools/requirements.in
# via -r .ci/requirements.in
pyproject-hooks==1.1.0 \
--hash=sha256:4b37730834edbd6bd37f26ece6b44802fb1c1ee2ece0e54ddff8bfc06db86965 \
--hash=sha256:7ceeefe9aec63a1064c18d939bdc3adf2d8aa1988a510afec15151578b232aa2
Expand Down
41 changes: 0 additions & 41 deletions .ci/requirements/Makefile

This file was deleted.

12 changes: 0 additions & 12 deletions .ci/requirements/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions .ci/requirements/benchmark/requirements.in

This file was deleted.

Loading

0 comments on commit ae60d18

Please sign in to comment.