Skip to content

Commit 0ab8411

Browse files
Feature/dockerization (#5)
* Added Dockerfile and docker image build workflow * Updated docker-imagel.yml * Minor change to the docker image build action * Changed trigger for docker image publishing --------- Co-authored-by: Stefano Germano <[email protected]>
1 parent d41c1c5 commit 0ab8411

File tree

5 files changed

+128
-2
lines changed

5 files changed

+128
-2
lines changed

.dockerignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Include any files or directories that you don't want to be copied to your
2+
# container here (e.g., local build artifacts, temporary files, etc.).
3+
#
4+
# For more help, visit the .dockerignore file reference guide at
5+
# https://docs.docker.com/engine/reference/builder/#dockerignore-file
6+
7+
**/.DS_Store
8+
**/__pycache__
9+
**/.venv
10+
**/.classpath
11+
**/.dockerignore
12+
**/.env
13+
**/.git
14+
**/.gitignore
15+
**/.project
16+
**/.settings
17+
**/.toolstarget
18+
**/.vs
19+
**/.vscode
20+
**/*.*proj.user
21+
**/*.dbmdl
22+
**/*.jfm
23+
**/bin
24+
**/charts
25+
**/docker-compose*
26+
**/compose*
27+
**/Dockerfile*
28+
**/node_modules
29+
**/npm-debug.log
30+
**/obj
31+
**/secrets.dev.yaml
32+
**/values.dev.yaml
33+
LICENSE
34+
README.md

.github/workflows/docker-image.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Docker Image CI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
push_to_registry:
9+
name: Push Docker image to Docker Hub
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out the repo
13+
uses: actions/checkout@v4
14+
15+
- name: DLV folder creation
16+
run: mkdir -p executables/dlv
17+
18+
- name: DLV2 folder creation
19+
run: mkdir executables/dlv2
20+
21+
- name: Clingo folder creation
22+
run: mkdir executables/clingo
23+
24+
- name: Download DLV executables
25+
run: |
26+
wget -O dlv https://www.dlvsystem.it/files/dlv.x86-64-linux-elf-static.bin
27+
mv dlv executables/dlv
28+
29+
- name: Download DLV2 executables
30+
run: |
31+
wget -O dlv https://www.mat.unical.it/DLV2/releases/2.1.2/dlv-2.1.2-linux-x86_64
32+
mv dlv executables/dlv2
33+
34+
- name: Download Clingo executables
35+
run: |
36+
wget -O clingo.tar.gz https://master.dl.sourceforge.net/project/potassco/clingo/4.5.4/clingo-4.5.4-linux-x86_64.tar.gz?viasf=1
37+
38+
- name: Extract Clingo
39+
run: |
40+
tar -xzf clingo.tar.gz
41+
cd clingo-4.5.4-linux-x86_64
42+
mv clingo ../executables/clingo
43+
44+
- name: Download timeout script
45+
run: |
46+
wget -O timeout https://github.com/DeMaCS-UNICAL/PythonESE/releases/download/v0.1.0/timeout
47+
mv timeout executables/timeout
48+
49+
- name: Make DLV executable
50+
run: chmod +x executables/dlv/dlv
51+
52+
- name: Make DLV2 executable
53+
run: chmod +x executables/dlv2/dlv-2.1.1-linux-x86
54+
55+
- name: Make Clingo executable
56+
run: chmod +x executables/clingo/clingo
57+
58+
- name: Make timeout executable
59+
run: chmod +x executables/timeout
60+
61+
- name: Log in to Docker Hub
62+
uses: docker/login-action@v3
63+
with:
64+
username: ${{ secrets.DOCKERHUB_USERNAME }}
65+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
66+
67+
- name: Extract metadata (tags, labels) for Docker
68+
id: meta
69+
uses: docker/metadata-action@v5
70+
with:
71+
images: loideunical/loide:ese
72+
- name: Build and push
73+
uses: docker/build-push-action@v5
74+
with:
75+
context: .
76+
platforms: linux/amd64
77+
push: true
78+
tags: loideunical/loide:ese
79+
build-args:
80+
81+

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt update
4+
RUN apt install python3 python3-pip -y
5+
COPY . .
6+
7+
RUN pip install -r requirements.txt
8+
9+
RUN apt-get install bubblewrap
10+
11+
CMD python3 embasp_server_executor/ese_main.py

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
embasp-python
22
tornado
3-
antlr4-python3-runtime==4.7
3+
antlr4-python3-runtime==4.7

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
packages=find_packages(),
1010
scripts=['embasp_server_executor/ese_main.py'],
1111

12-
install_requires=['embasp', 'tornado', 'antlr4-python3-runtime'],
12+
install_requires=['embasp-python', 'tornado', 'antlr4-python3-runtime'],
1313
package_data={
1414
'': ['*.txt', '*.md'],
1515
},

0 commit comments

Comments
 (0)