Browse Source

Cleanup dockerfile and add editorconfig

Updates dockerfile to use python 3.5 base image and
reorders to take advantage of image layering caching better
Removes some outdated and unused files
adds .editorconfig file
adds .vscode to gitignore

Change-Id: I08571b7176f0cb9fab42f072326c6c14d86d518a
changes/87/569187/1
Bryan Strassner 4 years ago
parent
commit
6cc7211630
  1. 27
      .editorconfig
  2. 3
      .gitignore
  3. 64
      images/shipyard/Dockerfile
  4. 12
      shipyard_airflow/README.md
  5. 18
      shipyard_client/setup.cfg

27
.editorconfig

@ -0,0 +1,27 @@
# EditorConfig is awesome: http://EditorConfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.py]
# Note: Undercloud components use PEP8 line length of 79
# Note: for VS Code, set "editor.rulers":[79] in your workspace settings
max_line_length = 79
[*.{yml,yaml}]
indent_size = 2
[Makefile]
indent_style = tab
[*.md]
# Note: VS Code may not honor the following setting
# See: https://github.com/editorconfig/editorconfig-vscode/issues/153
trim_trailing_whitespace = false

3
.gitignore vendored

@ -110,3 +110,6 @@ AUTHORS
/charts/shipyard/charts
/charts/shipyard/requirements.lock
.DS_Store
# vscode
.vscode/

64
images/shipyard/Dockerfile

@ -12,69 +12,37 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:16.04
FROM python:3.5
ENV DEBIAN_FRONTEND noninteractive
ENV container docker
ENV PORT 9000
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
RUN set -x && \
apt-get -qq update && \
apt-get -y install \
git \
curl \
netcat \
netbase \
python3 \
python3-setuptools \
python3-pip \
python3-dev \
python3-dateutil \
ca-certificates \
gcc \
g++ \
make \
libffi-dev \
libssl-dev \
libpq-dev \
--no-install-recommends \
&& python3 -m pip install -U pip \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/* \
/usr/share/man \
/usr/share/doc \
/usr/share/doc-base
# Expose port 9000 for application
EXPOSE $PORT
# Execute entrypoint
ENTRYPOINT ["/home/shipyard/entrypoint.sh"]
CMD ["server"]
# Create shipyard user
RUN useradd -ms /bin/bash shipyard
# Clone the shipyard repository
COPY . /home/shipyard/shipyard
# Set work directory
# Install dependency requirements and packages
WORKDIR /home/shipyard/shipyard
RUN pip3 install -r requirements.txt
RUN python3 setup.py install
# Copy entrypoint.sh to /home/shipyard
COPY entrypoint.sh /home/shipyard/entrypoint.sh
# Change permissions
RUN chown -R shipyard: /home/shipyard \
&& chmod +x /home/shipyard/entrypoint.sh
# Set user to shipyard
USER shipyard
# Expose port 9000 for application
EXPOSE 9000
# Set work directory and install dependencies
WORKDIR /home/shipyard/shipyard
COPY requirements.txt /home/shipyard/shipyard
RUN pip3 install -r requirements.txt
# Execute entrypoint
ENTRYPOINT ["/home/shipyard/entrypoint.sh"]
COPY . /home/shipyard/shipyard
RUN python3 setup.py install
CMD ["server"]
# Set user to shipyard
USER shipyard

12
shipyard_airflow/README.md

@ -1,12 +0,0 @@
## Shipyard Airflow ##
A python REST workflow orchestrator
To run:
```
$ virtualenv -p python3 /var/tmp/shipyard
$ . /var/tmp/shipyard/bin/activate
$ python setup.py install
$ uwsgi --http :9000 -w shipyard_airflow.shipyard --callable shipyard -L
```

18
shipyard_client/setup.cfg

@ -1,18 +0,0 @@
[metadata]
name = shipyard client
summary = Shipyard client library and CLI
description-file = README.md
author = undercloud team
home-page = https://github.com/att-comdev/shipyard/shipyard_client
classifier =
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
[build_sphinx]
warning-is-error = True
Loading…
Cancel
Save