Skip to content

Commit e15db00

Browse files
committed
Align with assemblyline-service-template
1 parent c0aad0e commit e15db00

File tree

6 files changed

+269
-73
lines changed

6 files changed

+269
-73
lines changed

.dockerignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Dockerfile
2+
.idea
3+
.git
4+
.gitignore
5+
.vscode
6+
.dockerignore
7+
8+
pipelines
9+
venv
10+
.venv
11+
env
12+
.env
13+
test
14+
tests
15+
examples
16+
docs
17+
18+
build
19+
dist
20+
**/__pycache__
21+
**/*.pyc
22+
23+
pip-log.txt
24+
pip-delete-this-directory.txt
25+
.tox
26+
.coverage
27+
.coverage.*
28+
.cache
29+
nosetests.xml
30+
coverage.xml
31+
*.cover
32+
*.log

.gitignore

Lines changed: 214 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,216 @@
1-
.DS_Store
1+
# Created by https://www.toptal.com/developers/gitignore/api/python,vim,visualstudiocode
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,vim,visualstudiocode
3+
4+
### Python ###
5+
# Byte-compiled / optimized / DLL files
26
__pycache__/
37
*.py[cod]
4-
.scannerwork/
5-
.venv/*
6-
data/
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
develop-eggs/
17+
dist/
18+
downloads/
19+
eggs/
20+
.eggs/
21+
lib/
22+
lib64/
23+
parts/
24+
sdist/
25+
var/
26+
wheels/
27+
share/python-wheels/
28+
*.egg-info/
29+
.installed.cfg
30+
*.egg
31+
MANIFEST
32+
33+
# PyInstaller
34+
# Usually these files are written by a python script from a template
35+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36+
*.manifest
37+
*.spec
38+
39+
# Installer logs
40+
pip-log.txt
41+
pip-delete-this-directory.txt
42+
43+
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
46+
.nox/
47+
.coverage
48+
.coverage.*
49+
.cache
50+
nosetests.xml
51+
coverage.xml
52+
*.cover
53+
*.py,cover
54+
.hypothesis/
55+
.pytest_cache/
56+
cover/
57+
58+
# Translations
59+
*.mo
60+
*.pot
61+
62+
# Django stuff:
63+
*.log
64+
local_settings.py
65+
db.sqlite3
66+
db.sqlite3-journal
67+
68+
# Flask stuff:
69+
instance/
70+
.webassets-cache
71+
72+
# Scrapy stuff:
73+
.scrapy
74+
75+
# Sphinx documentation
76+
docs/_build/
77+
78+
# PyBuilder
79+
.pybuilder/
80+
target/
81+
82+
# Jupyter Notebook
83+
.ipynb_checkpoints
84+
85+
# IPython
86+
profile_default/
87+
ipython_config.py
88+
89+
# pyenv
90+
# For a library or package, you might want to ignore these files since the code is
91+
# intended to run in multiple environments; otherwise, check them in:
92+
# .python-version
93+
94+
# pipenv
95+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
97+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
98+
# install all needed dependencies.
99+
#Pipfile.lock
100+
101+
# poetry
102+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103+
# This is especially recommended for binary packages to ensure reproducibility, and is more
104+
# commonly ignored for libraries.
105+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106+
#poetry.lock
107+
108+
# pdm
109+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110+
#pdm.lock
111+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112+
# in version control.
113+
# https://pdm.fming.dev/#use-with-ide
114+
.pdm.toml
115+
116+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117+
__pypackages__/
118+
119+
# Celery stuff
120+
celerybeat-schedule
121+
celerybeat.pid
122+
123+
# SageMath parsed files
124+
*.sage.py
125+
126+
# Environments
127+
.env
128+
.venv
129+
env/
130+
venv/
131+
ENV/
132+
env.bak/
133+
venv.bak/
134+
135+
# Spyder project settings
136+
.spyderproject
137+
.spyproject
138+
139+
# Rope project settings
140+
.ropeproject
141+
142+
# mkdocs documentation
143+
/site
144+
145+
# mypy
146+
.mypy_cache/
147+
.dmypy.json
148+
dmypy.json
149+
150+
# Pyre type checker
151+
.pyre/
152+
153+
# pytype static type analyzer
154+
.pytype/
155+
156+
# Cython debug symbols
157+
cython_debug/
158+
159+
# PyCharm
160+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162+
# and can be added to the global gitignore or merged into this file. For a more nuclear
163+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
164+
#.idea/
165+
166+
### Python Patch ###
167+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168+
poetry.toml
169+
170+
# ruff
171+
.ruff_cache/
172+
173+
# LSP config files
174+
pyrightconfig.json
175+
176+
### Vim ###
177+
# Swap
178+
[._]*.s[a-v][a-z]
179+
!*.svg # comment out if you don't need vector files
180+
[._]*.sw[a-p]
181+
[._]s[a-rt-v][a-z]
182+
[._]ss[a-gi-z]
183+
[._]sw[a-p]
184+
185+
# Session
186+
Session.vim
187+
Sessionx.vim
188+
189+
# Temporary
190+
.netrwhist
191+
*~
192+
# Auto-generated tag files
193+
tags
194+
# Persistent undo
195+
[._]*.un~
196+
197+
### VisualStudioCode ###
198+
.vscode/*
199+
!.vscode/settings.json
200+
!.vscode/tasks.json
201+
!.vscode/launch.json
202+
!.vscode/extensions.json
203+
!.vscode/*.code-snippets
204+
205+
# Local History for Visual Studio Code
206+
.history/
207+
208+
# Built Visual Studio Code Extensions
209+
*.vsix
210+
211+
### VisualStudioCode Patch ###
212+
# Ignore all local history of files
213+
.history
214+
.ionide
215+
216+
# End of https://www.toptal.com/developers/gitignore/api/python,vim,visualstudiocode

Dockerfile

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
ARG branch=stable
1+
ARG branch=latest
22
FROM cccs/assemblyline-v4-service-base:$branch
33

44
# Python path to the service class from your service directory
55
ENV SERVICE_PATH=vmray_service.VMRayService
66

77
# Install apt dependencies
88
USER root
9+
COPY pkglist.txt /tmp/setup/
10+
RUN apt-get update && \
11+
apt-get upgrade -y && \
12+
apt-get install -y --no-install-recommends \
13+
$(grep -vE "^\s*(#|$)" /tmp/setup/pkglist.txt | tr "\n" " ") && \
14+
rm -rf /tmp/setup/pkglist.txt /var/lib/apt/lists/*
915

10-
RUN apt-get update -y && apt-get upgrade -y && \
11-
apt-get install -y git gcc build-essential curl unzip libssl-dev && \
12-
rm -rf /var/cache/apt && rm -rf /var/lib/apt
13-
14-
# Switch to assemblyline user
16+
# Install python dependencies
1517
USER assemblyline
18+
COPY requirements.txt requirements.txt
19+
RUN pip install \
20+
--no-cache-dir \
21+
--user \
22+
--requirement requirements.txt && \
23+
rm -rf ~/.cache/pip
1624

1725
# Copy service code
1826
WORKDIR /opt/al_service
19-
COPY requirements.txt .
20-
COPY vmray_service.py .
21-
COPY service_manifest.yml .
22-
23-
# Install python dependencies
24-
RUN pip install --no-cache-dir --user --requirement requirements.txt && \
25-
rm -rf ~/.cache/pip
27+
COPY . .
2628

2729
# Patch version in manifest
2830
ARG DOCKER_METADATA_OUTPUT_VERSION=1.0.0.dev1

pkglist.txt

Whitespace-only changes.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
assemblyline_v4_service
2-
assemblyline_service_client
1+
assemblyline
2+
assemblyline-v4-service
33
vmray-rest-api==6.0.0

0 commit comments

Comments
 (0)