Skip to content

Commit

Permalink
fix for git dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Oct 21, 2020
1 parent 1d78d66 commit b8f61ad
Show file tree
Hide file tree
Showing 7 changed files with 633 additions and 966 deletions.
30 changes: 11 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ ENV appname=fence
RUN apk update \
&& apk add postgresql-libs postgresql-dev libffi-dev libressl-dev \
&& apk add linux-headers musl-dev gcc \
&& apk add curl bash git vim make lftp

COPY . /$appname
COPY ./deployment/uwsgi/uwsgi.ini /etc/uwsgi/uwsgi.ini
COPY ./deployment/uwsgi/wsgi.py /$appname/wsgi.py
WORKDIR /$appname
&& apk add curl bash git vim make lftp \
&& apk update && apk add openssh && apk add libmcrypt-dev

RUN mkdir -p /var/www/$appname \
&& mkdir -p /var/www/.cache/Python-Eggs/ \
Expand All @@ -23,8 +19,6 @@ RUN mkdir -p /var/www/$appname \
&& chown nginx -R /var/www/.cache/Python-Eggs/ \
&& chown nginx /var/www/$appname

RUN apk update && apk add openssh && apk add libmcrypt-dev

#
# libmhash is required by mcrypt - below - no apk package available
#
Expand Down Expand Up @@ -53,26 +47,24 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
&& /bin/rm -rf awscliv2.zip ./aws

# install poetry
ENV POETRY_HOME="$HOME/.poetry/bin"
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
# ENV PATH="$POETRY_HOME/bin$PATH"
# ENV PATH="usr/local/src$PATH" <-- pythonpath
ENV PYTHONPATH="${PYTHONPATH}:/usr/local/src/"
RUN echo $PYTHONPATH

RUN COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" >$appname/version_data.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >>$appname/version_data.py
COPY . /$appname
COPY ./deployment/uwsgi/uwsgi.ini /etc/uwsgi/uwsgi.ini
COPY ./deployment/uwsgi/wsgi.py /$appname/wsgi.py
WORKDIR /$appname

# cache so that poetry install will run if these files change
COPY poetry.lock pyproject.toml /$appname
COPY poetry.lock pyproject.toml /$appname/

# install Fence and dependencies via poetry
RUN source $HOME/.poetry/env \
&& poetry config virtualenvs.create false \
&& poetry install -vv --no-dev --no-interaction \
&& pip list
RUN pip show flask
RUN pip show gen3config
&& poetry show -v

RUN COMMIT=`git rev-parse HEAD` && echo "COMMIT=\"${COMMIT}\"" >$appname/version_data.py \
&& VERSION=`git describe --always --tags` && echo "VERSION=\"${VERSION}\"" >>$appname/version_data.py

WORKDIR /var/www/$appname

Expand Down
2 changes: 2 additions & 0 deletions deployment/uwsgi/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ vacuum = true
pythonpath = /var/www/fence/
pythonpath = /fence/
pythonpath = /usr/local/lib/python3.6/site-packages/
# poetry installs git dependencies at /usr/local/src
pythonpath = /usr/local/src/*

# Initialize application in worker processes, not master. This prevents the
# workers from all trying to open the same database connections at startup.
Expand Down
2 changes: 1 addition & 1 deletion fence/blueprints/data/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def upload_data_file():
if not authorized:
raise Forbidden(
"You do not have access to upload data. You either need "
"general file uploader permissions or create & write-storage permissions "
"general file uploader permissions or create and write-storage permissions "
"on the authz resources you specified (if you specified any)."
)

Expand Down
2 changes: 1 addition & 1 deletion fence/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from userdatamodel.driver import SQLAlchemyDriver
from werkzeug.datastructures import ImmutableMultiDict

from fence.models import Client, GrantType, User, query_for_user
from fence.models import Client, User, query_for_user
from fence.errors import NotFound, UserError
from fence.config import config

Expand Down
10 changes: 0 additions & 10 deletions notes.txt

This file was deleted.

Loading

0 comments on commit b8f61ad

Please sign in to comment.