Skip to content

Commit f5ff09e

Browse files
adds submodule, builds and ci
1 parent 2212b09 commit f5ff09e

File tree

9 files changed

+230
-1
lines changed

9 files changed

+230
-1
lines changed

.drone.yml

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
kind: pipeline
2+
type: docker
3+
name: amd64
4+
5+
platform:
6+
arch: amd64
7+
8+
steps:
9+
- name: submodules
10+
image: alpine/git
11+
commands:
12+
- git submodule init
13+
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
14+
- "git submodule update --recursive --remote"
15+
- name: build and publish
16+
image: plugins/docker
17+
settings:
18+
registry: registry.dev.onetask.ai
19+
username:
20+
from_secret: docker_username
21+
password:
22+
from_secret: docker_password
23+
repo: "registry.dev.onetask.ai/code-kern-ai/refinery-parent-images"
24+
tags: ["${DRONE_COMMIT_SHA}-torch-cuda", "${DRONE_COMMIT_BRANCH}-torch-cuda"]
25+
cache_from:
26+
- "registry.dev.onetask.ai/code-kern-ai/refinery-parent-images:dev-torch-cuda"
27+
- "registry.dev.onetask.ai/code-kern-ai/refinery-parent-images:${DRONE_COMMIT_BRANCH}-torch-cuda"
28+
29+
trigger:
30+
event:
31+
- push
32+
33+
---
34+
kind: pipeline
35+
type: docker
36+
name: arm64
37+
38+
platform:
39+
arch: arm64
40+
41+
steps:
42+
- name: submodules
43+
image: alpine/git
44+
commands:
45+
- git submodule init
46+
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
47+
- "git submodule update --recursive --remote"
48+
- name: build and publish
49+
image: plugins/docker
50+
settings:
51+
registry: registry.dev.onetask.ai
52+
username:
53+
from_secret: docker_username
54+
password:
55+
from_secret: docker_password
56+
repo: "registry.dev.onetask.ai/code-kern-ai/refinery-parent-images"
57+
tags: ["${DRONE_COMMIT_SHA}-torch-cuda-arm64", "${DRONE_COMMIT_BRANCH}-torch-cuda-arm64"]
58+
cache_from:
59+
- "registry.dev.onetask.ai/code-kern-ai/refinery-parent-images:dev-torch-cuda-arm64"
60+
- "registry.dev.onetask.ai/code-kern-ai/refinery-parent-images:${DRONE_COMMIT_BRANCH}-torch-cuda-arm64"
61+
62+
trigger:
63+
branch:
64+
- dev
65+
event:
66+
- push
67+
68+
---
69+
kind: pipeline
70+
type: docker
71+
name: amd64-dockerhub
72+
73+
platform:
74+
arch: amd64
75+
76+
steps:
77+
- name: submodules
78+
image: alpine/git
79+
commands:
80+
- git submodule init
81+
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
82+
- "git submodule update --recursive --remote"
83+
- name: build and publish
84+
image: plugins/docker
85+
settings:
86+
username:
87+
from_secret: dockerhub_username
88+
password:
89+
from_secret: dockerhub_password
90+
repo: "kernai/refinery-parent-images"
91+
tag: "${DRONE_TAG}-torch-cuda-drone-amd64"
92+
93+
trigger:
94+
event:
95+
- tag
96+
97+
---
98+
kind: pipeline
99+
type: docker
100+
name: arm64-dockerhub
101+
102+
platform:
103+
arch: arm64
104+
105+
steps:
106+
- name: submodules
107+
image: alpine/git
108+
commands:
109+
- git submodule init
110+
- 'git config --global url."https://github.com/".insteadOf git@github.com:'
111+
- "git submodule update --recursive --remote"
112+
- name: build and publish
113+
image: plugins/docker
114+
settings:
115+
username:
116+
from_secret: dockerhub_username
117+
password:
118+
from_secret: dockerhub_password
119+
repo: "kernai/refinery-parent-images"
120+
tag: "${DRONE_TAG}-torch-cuda-drone-arm64"
121+
122+
trigger:
123+
event:
124+
- tag
125+
126+
---
127+
kind: pipeline
128+
name: manifest
129+
steps:
130+
- name: manifest
131+
image: plugins/manifest
132+
settings:
133+
spec: manifest.tmpl
134+
username:
135+
from_secret: dockerhub_username
136+
password:
137+
from_secret: dockerhub_password
138+
139+
depends_on:
140+
- amd64-dockerhub
141+
- arm64-dockerhub
142+
143+
trigger:
144+
event:
145+
- tag

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "submodules/parent-images"]
2+
path = submodules/parent-images
3+
url = https://github.com/code-kern-ai/refinery-submodule-parent-images.git

Dockerfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM nvidia/cuda:11.6.0-base-ubuntu20.04
2+
3+
RUN apt-get update && \
4+
apt-get install --no-install-recommends --no-install-suggests -y \
5+
curl software-properties-common && \
6+
rm -rf /var/lib/apt/lists/*
7+
8+
RUN add-apt-repository ppa:deadsnakes/ppa && \
9+
apt-get install --no-install-recommends --no-install-suggests -y \
10+
python3.9 python3.9-distutils && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.9
14+
15+
COPY submodules/parent-images/requirements/torch-cuda-requirements.txt .
16+
17+
RUN pip3 install --no-cache-dir -r torch-cuda-requirements.txt

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2022 onetask.ai GmbH
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# refinery-torch-cuda-parent-image
2+
[![refinery repository](https://uploads-ssl.webflow.com/61e47fafb12bd56b40022a49/62c2f30f935f4d37dc864eeb_Kern%20refinery.png)](https://github.com/code-kern-ai/refinery)
3+
4+
Defines parent image for the Docker images of the [refinery](https://github.com/code-kern-ai/refinery) services that require torch (cpu).
5+
6+
If you like what we're working on, please leave a ⭐ for [refinery](https://github.com/code-kern-ai/refinery)!

build

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
VERSION=v1.5.0
4+
5+
docker build -t kernai/refinery-parent-images:$VERSION-torch-cuda -f Dockerfile .

manifest.tmpl

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
image: kernai/refinery-parent-images:{{build.tag}}-torch-cuda
2+
manifests:
3+
-
4+
image: kernai/refinery-parent-images:{{build.tag}}-torch-cuda-drone-amd64
5+
platform:
6+
architecture: amd64
7+
os: linux
8+
-
9+
image: kernai/refinery-parent-images:{{build.tag}}-torch-cuda-drone-arm64
10+
platform:
11+
architecture: arm64
12+
os: linux
13+
variant: v8

smodules

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
pull() {
4+
echo "Pulling data...";
5+
git submodule foreach git pull
6+
echo "Pulling done";
7+
}
8+
9+
10+
push() {
11+
echo "Preparing push...";
12+
git submodule foreach git add .
13+
git submodule foreach git commit -m "$@"
14+
git submodule foreach git push
15+
echo "Pushed (if there were any changes that is...)";
16+
}
17+
18+
19+
init() {
20+
echo "Initializing submodules..."
21+
git submodule update --init
22+
git submodule foreach git checkout dev
23+
echo "Initializing complete"
24+
}
25+
26+
if [ "$1" == "init" ]; then
27+
init
28+
else
29+
if [ "$1" == "pull" ]; then
30+
pull
31+
else
32+
if [ "$1" == "push" ]; then
33+
if [ -z ${2+x} ];
34+
then echo "Please provide a commit message";
35+
else push "$2";
36+
fi
37+
fi
38+
fi
39+
fi

submodules/parent-images

Submodule parent-images added at ce5ce5f

0 commit comments

Comments
 (0)