Skip to content

Commit 5587a5a

Browse files
committed
Generate whole directories using distgen
1 parent 34bb9b3 commit 5587a5a

33 files changed

+1175
-15
lines changed

2.7/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ $ curl 127.0.0.1:8080
4646
Environment variables
4747
---------------------
4848
49-
To set these environment variables, you can place them as a key value pair into
50-
a `.s2i/environment` file inside your source code repository.
49+
To set these environment variables, you can place them as a key value pair into a `.s2i/environment`
50+
file inside your source code repository.
5151
5252
* **APP_SCRIPT**
5353

2.7/content_sets.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is a file defining which content sets are needed to update content in
1+
# This is a file defining which content sets are needed to update content in
22
# this image. Data provided here helps determine which images are vulnerable to
33
# specific CVEs. Generally you should only need to update this file when:
44
# 1. You start depending on new product

2.7/s2i/bin/run

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function get_default_web_concurrency() {
2525
fi
2626

2727
local max=$((NUMBER_OF_CORES*2))
28-
# Require at least 40 MiB and additional 40 MiB for every worker
29-
local default=$(((${MEMORY_LIMIT_IN_BYTES:-MAX_MEMORY_LIMIT_IN_BYTES}/1024/1024 - 40) / 40))
28+
# Require at least 43 MiB and additional 40 MiB for every worker
29+
local default=$(((${MEMORY_LIMIT_IN_BYTES:-MAX_MEMORY_LIMIT_IN_BYTES}/1024/1024 - 43) / 40))
3030
default=$((default > max ? max : default))
3131
default=$((default < 1 ? 1 : default))
3232
# According to http://docs.gunicorn.org/en/stable/design.html#how-many-workers,

3.4/content_sets.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is a file defining which content sets are needed to update content in
1+
# This is a file defining which content sets are needed to update content in
22
# this image. Data provided here helps determine which images are vulnerable to
33
# specific CVEs. Generally you should only need to update this file when:
44
# 1. You start depending on new product

3.4/s2i/bin/assemble

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function install_pipenv() {
2525
echo "---> Installing pipenv packaging tool ..."
2626
pip install -U virtualenv
2727
VENV_DIR=$HOME/.local/venvs/pipenv
28-
virtualenv_bin $VENV_DIR
28+
virtualenv_bin "$VENV_DIR"
2929
$VENV_DIR/bin/pip --isolated install -U pipenv
3030
mkdir -p $HOME/.local/bin
3131
ln -s $VENV_DIR/bin/pipenv $HOME/.local/bin/pipenv

3.5/content_sets.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is a file defining which content sets are needed to update content in
1+
# This is a file defining which content sets are needed to update content in
22
# this image. Data provided here helps determine which images are vulnerable to
33
# specific CVEs. Generally you should only need to update this file when:
44
# 1. You start depending on new product

3.5/s2i/bin/assemble

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function install_pipenv() {
2525
echo "---> Installing pipenv packaging tool ..."
2626
pip install -U virtualenv
2727
VENV_DIR=$HOME/.local/venvs/pipenv
28-
virtualenv_bin $VENV_DIR
28+
virtualenv_bin "$VENV_DIR"
2929
$VENV_DIR/bin/pip --isolated install -U pipenv
3030
mkdir -p $HOME/.local/bin
3131
ln -s $VENV_DIR/bin/pipenv $HOME/.local/bin/pipenv

3.6/content_sets.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is a file defining which content sets are needed to update content in
1+
# This is a file defining which content sets are needed to update content in
22
# this image. Data provided here helps determine which images are vulnerable to
33
# specific CVEs. Generally you should only need to update this file when:
44
# 1. You start depending on new product

3.6/root/opt/app-root/etc/scl_enable

-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
# This will make scl collection binaries work out of box.
44
unset BASH_ENV PROMPT_COMMAND ENV
55
source scl_source enable httpd24 $NODEJS_SCL rh-python36
6-
source scl_source enable httpd24 rh-python36
76
source /opt/app-root/bin/activate

3.6/s2i/bin/assemble

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function virtualenv_bin() {
2424
function install_pipenv() {
2525
echo "---> Installing pipenv packaging tool ..."
2626
VENV_DIR=$HOME/.local/venvs/pipenv
27-
virtualenv_bin $VENV_DIR
27+
virtualenv_bin "$VENV_DIR"
2828
$VENV_DIR/bin/pip --isolated install -U pipenv
2929
mkdir -p $HOME/.local/bin
3030
ln -s $VENV_DIR/bin/pipenv $HOME/.local/bin/pipenv

3.6/test/pipenv-test-app

-1
This file was deleted.

3.6/test/pipenv-test-app/.gitignore

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
5+
# C extensions
6+
*.so
7+
8+
# Distribution / packaging
9+
.Python
10+
env/
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
# PyInstaller
27+
# Usually these files are written by a python script from a template
28+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.coverage
40+
.coverage.*
41+
.cache
42+
nosetests.xml
43+
coverage.xml
44+
*,cover
45+
46+
# Translations
47+
*.mo
48+
*.pot
49+
50+
# Django stuff:
51+
*.log
52+
53+
# Sphinx documentation
54+
docs/_build/
55+
56+
# PyBuilder
57+
target/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ENABLE_PIPENV=true

3.6/test/pipenv-test-app/Pipfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[[source]]
2+
url = "https://pypi.python.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
"e1839a8" = {path = ".", editable = true}
8+
requests = "==2.17.0"
9+
10+
[dev-packages]
11+
pytest = ">=2.8.0"
12+
13+
[requires]
14+
python_version = "3.6"

3.6/test/pipenv-test-app/Pipfile.lock

+95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

3.6/test/pipenv-test-app/setup.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from setuptools import setup, find_packages
2+
3+
4+
setup (
5+
name = "testapp",
6+
version = "0.1",
7+
description = "Example application to be deployed.",
8+
packages = find_packages(),
9+
install_requires = ["gunicorn"],
10+
)

3.6/test/pipenv-test-app/testapp.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import requests
2+
3+
4+
def application(environ, start_response):
5+
start_response('200 OK', [('Content-Type', 'text/plain')])
6+
assert requests.__version__ == '2.17.0'
7+
return [b"Hello from gunicorn WSGI application!"]

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ For more information about concepts used in these container images, see the
1515

1616
Contributing
1717
---------------
18-
In this repository [distgen](https://github.com/devexp-db/distgen/) > 0.14 is used for generating Dockerfiles. If you'd like update a Dockerfile, please make changes in specs/multispec.yml and/or templates under src/ (or other distgen file) and run `make generate-all`.
18+
In this repository [distgen](https://github.com/devexp-db/distgen/) > 1.0 is used for generating directories for Python versions. Also make sure distgen imports the jinja2 package >= 2.10. If you'd like to update some of the files, please make changes in specs/multispec.yml and/or templates under src/ and run `make generate-all`.
1919

2020
For more information about contributing, see
2121
[the Contribution Guidelines](https://github.com/sclorg/welcome/blob/master/contribution.md).

manifest.sh

+96-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11
# Manifest for Dockerfiles creation
22
# every dest path will be prefixed by $DESTDIR/$version
33

4+
# Files containing distgen directives
5+
DISTGEN_RULES="
6+
src=src/cccp.yml
7+
dest=cccp.yml;
8+
9+
src=src/README.md
10+
dest=README.md;
11+
12+
src=src/root/opt/app-root/etc/scl_enable
13+
dest=root/opt/app-root/etc/scl_enable;
14+
15+
src=src/s2i/bin/assemble
16+
dest=s2i/bin/assemble
17+
mode=0755;
18+
19+
src=src/s2i/bin/usage
20+
dest=s2i/bin/usage
21+
mode=0755;
22+
23+
src=src/test/pipenv-test-app/Pipfile
24+
dest=test/pipenv-test-app/Pipfile;
25+
26+
src=src/test/pipenv-test-app/Pipfile.lock
27+
dest=test/pipenv-test-app/Pipfile.lock;
28+
"
29+
30+
# Files containing distgen directives, which are used for each
31+
# (distro, version) combination not excluded in multispec
432
DISTGEN_MULTI_RULES="
533
src=src/Dockerfile.template
634
dest=Dockerfile;
@@ -9,5 +37,72 @@ DISTGEN_MULTI_RULES="
937
dest=Dockerfile.rhel7;
1038
1139
src=src/Dockerfile.template
12-
dest=Dockerfile.fedora
40+
dest=Dockerfile.fedora;
41+
"
42+
43+
# Symbolic links
44+
SYMLINK_RULES="
45+
link_target=../../examples/app-home-test-app
46+
link_name=test/app-home-test-app;
47+
48+
link_target=../../examples/django-test-app
49+
link_name=test/django-test-app;
50+
51+
link_target=../../examples/locale-test-app
52+
link_name=test/locale-test-app;
53+
54+
link_target=../../examples/mod-wsgi-test-app
55+
link_name=test/mod-wsgi-test-app;
56+
57+
link_target=../../examples/npm-virtualenv-uwsgi-test-app
58+
link_name=test/npm-virtualenv-uwsgi-test-app;
59+
60+
link_target=../../examples/numpy-test-app
61+
link_name=test/numpy-test-app;
62+
63+
link_target=../../examples/setup-requirements-test-app
64+
link_name=test/setup-requirements-test-app;
65+
66+
link_target=../../examples/setup-test-app
67+
link_name=test/setup-test-app;
68+
69+
link_target=../../examples/standalone-test-app
70+
link_name=test/standalone-test-app;
71+
72+
link_target=../../test/run
73+
link_name=test/run;
74+
75+
link_target=../../test/run-openshift
76+
link_name=test/run-openshift;
77+
78+
link_target=../../common/test-lib.sh
79+
link_name=test/test-lib.sh;
80+
81+
link_target=../../common/test-lib-openshift.sh
82+
link_name=test/test-lib-openshift.sh;
83+
"
84+
85+
# Files to copy
86+
COPY_RULES="
87+
src=src/content_sets.yml
88+
dest=content_sets.yml;
89+
90+
src=src/root/opt/app-root/etc/generate_container_user
91+
dest=root/opt/app-root/etc/generate_container_user;
92+
93+
src=src/s2i/bin/run
94+
dest=s2i/bin/run
95+
mode=0755;
96+
97+
src=examples/pipenv-test-app/testapp.py
98+
dest=test/pipenv-test-app/testapp.py;
99+
100+
src=examples/pipenv-test-app/setup.py
101+
dest=test/pipenv-test-app/setup.py;
102+
103+
src=examples/pipenv-test-app/.s2i/environment
104+
dest=test/pipenv-test-app/.s2i/environment;
105+
106+
src=examples/pipenv-test-app/.gitignore
107+
dest=test/pipenv-test-app/.gitignore;
13108
"

0 commit comments

Comments
 (0)