Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: Use usermod instead of addgroup in the Dockerfile template. #306

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a105150
RF: Use usermod instead of addgroup in the Dockerfile template.
arokem Jul 29, 2023
a0912a8
Apply change of adduser to usermod in the test Dockerfiles as well.
arokem Jul 29, 2023
1fcdcf5
Removes testing on older Python version (3.6 and 3.7)
arokem Jul 29, 2023
dd33e9c
Build the docs only on 3.9
arokem Jul 29, 2023
e315ae1
Update call to pip installation.
arokem Jul 29, 2023
535b656
Build docs on both 3.9 and 3.10.
arokem Jul 29, 2023
44aa104
Update black/pre-commit configuration/versions.
arokem Jul 29, 2023
9fd2907
More compatibility issues
arokem Jul 29, 2023
9b760da
Update deprecated imports from the collections module.
arokem Jul 29, 2023
5c45502
Upgrade black
arokem Jul 29, 2023
06ec1cd
Don't flake8 these files.
arokem Jul 29, 2023
ffc876b
Maybe we do need the extensions for these two files.
arokem Jul 29, 2023
14a7874
Exclude these directly on the CI.
arokem Jul 29, 2023
39c392d
Turns out this is not a flake8 thing, but a black thing.
arokem Jul 29, 2023
552a35f
Update pytest.
arokem Jul 29, 2023
5222377
Install moto with the optional cloudformation dependencies.
arokem Jul 29, 2023
f4e695e
Update to newer sphinx version.
arokem Jul 29, 2023
5854dd5
Replace underscore in username with dash, so that bucket names are S3…
arokem Jul 29, 2023
5d193a7
Replace right before setting the bucket name
arokem Jul 29, 2023
32af62e
Find a combination of awscli and sphinx versions that works
arokem Jul 30, 2023
7daf3f1
Try adding a shebang to the template. Otherwise running into 'exec fo…
arokem Jul 30, 2023
782bce7
use CMD instead of ENTRYPOINT
arokem Jul 30, 2023
0d3415d
Do the normal thing again
arokem Jul 30, 2023
29339e7
Use ENTRYPOINT, but be explicit about the python to call
arokem Jul 30, 2023
8f7051e
User call directly to Python again as instructed in python docker docs.
arokem Jul 30, 2023
9627abc
Upgrade sphinx version.
arokem Jan 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.9", "3.10"]

steps:
- name: Checkout repo
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
max-parallel: 8
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
python-version: ["3.8", "3.9", "3.10"]

steps:
- name: Checkout repo
Expand All @@ -19,9 +19,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install software
run: |
python -m pip install --upgrade pip --use-feature=2020-resolver
python -m pip install coveralls --use-feature=2020-resolver
python -m pip install .[dev] --use-feature=2020-resolver
python -m pip install --upgrade pip
python -m pip install coveralls
python -m pip install .[dev]
python -m pip install https://github.com/bboe/coveralls-python/archive/github_actions.zip
- name: Configure
run: |
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
repos:
- repo: https://github.com/python/black
rev: 22.1.0
rev: 23.7.0
hooks:
- id: black
language_version: python3.9
1 change: 1 addition & 0 deletions cloudknot/aws/base_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ def get_s3_params():

# Use set_s3_params to check for name availability
# and write to config file
bucket = bucket.replace("_", "-") # S3 does not allow underscores
set_s3_params(bucket=bucket, policy=policy, sse=sse)

if policy is None:
Expand Down
7 changes: 3 additions & 4 deletions cloudknot/cloudknot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
import logging
import os

try:
from collections.abc import Iterable, namedtuple
except ImportError:
from collections import Iterable, namedtuple
from collections.abc import Iterable
from collections import namedtuple

from concurrent.futures import ThreadPoolExecutor

from . import aws
Expand Down
2 changes: 1 addition & 1 deletion cloudknot/data/docker_reqs_ref_data/py3/ref1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Add user to "staff" group.
# Give user a home directory.
RUN (id -u cloudknot-user >/dev/null 2>&1 || useradd cloudknot-user) \
&& addgroup cloudknot-user staff \
&& usermod -a -G staff "cloudknot-user" \
&& mkdir -p /home/cloudknot-user \
&& chown -R cloudknot-user:staff /home/cloudknot-user

Expand Down
2 changes: 1 addition & 1 deletion cloudknot/data/docker_reqs_ref_data/py3/ref2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt
# Add user to "staff" group.
# Give user a home directory.
RUN (id -u unit-test-username >/dev/null 2>&1 || useradd unit-test-username) \
&& addgroup unit-test-username staff \
&& usermod -a -G staff "${unit-test-username}" \
&& mkdir -p /home/unit-test-username \
&& chown -R unit-test-username:staff /home/unit-test-username

Expand Down
2 changes: 1 addition & 1 deletion cloudknot/templates/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt${github_installs_string}
# Add user to "staff" group.
# Give user a home directory.
RUN (id -u ${username} >/dev/null 2>&1 || useradd ${username}) \
&& addgroup ${username} staff \
&& usermod -a -G staff "${username}" \
&& mkdir -p /home/${username} \
&& chown -R ${username}:staff /home/${username}

Expand Down
1 change: 1 addition & 0 deletions cloudknot/templates/script.template
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/python
import boto3
import cloudpickle
import os
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = '''
| build
| dist
)/
| foo.py # also separately exclude a file named foo.py in
# the root of the project
| _version.py
| cli.py
)
'''
13 changes: 6 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ setup_requires =
setuptools_scm
python_requires = >=3.6
install_requires =
awscli
boto3>=1.5.21
awscli>=1.28.0
botocore>=1.8.36
cloudpickle
docker>=3.0.0
Expand All @@ -53,18 +53,17 @@ console_scripts =

[options.extras_require]
dev =
black==20.8b1
black==23.7.0
coverage==5.3
flake8==3.8.3
numpydoc==1.1.0
moto>=2.2.13.dev2
responses==0.12.0
pre-commit==2.9.2
moto[cloudformation]==4.1.13
pre-commit==3.3.3
pydocstyle==5.1.1
pytest-cov==2.10.1
pytest-xdist[psutil]==2.1.0
pytest==6.0.1
sphinx==3.2.1
pytest==7.4.0
sphinx==5.0.0
maint =
rapidfuzz==0.12.2

Expand Down
Loading