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

Added converter service to prod #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kiat-huang
Copy link
Contributor

Following @zdraganov advice I created a separate GCP Project globalbridge-app (not namespace) for Prod, allowing the current project online-bridge-hackathon-2020 to be used for Dev - which still needs cleaning up. As part of this work I've installed Deal and got Converter working with Flask. Test command, curl -F "file=@/home/kiat/hack/Data-Converter/src/test.pbn" https://converter.prod.globalbridge.app/api/boards/test

src/api.py Outdated
#!/usr/bin/env python

import sys
sys.path.append('/home/kiat/.local/lib/python3.7/site-packages/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

@tameware
Copy link
Contributor

tameware commented Jul 6, 2020

This looks good to me, but I am not qualified to review Docker configs - I know nothing about them.

That said, if it works for you I suggest you go ahead and submit. We can always make changes later.

@tameware tameware closed this Jul 6, 2020
@tameware tameware reopened this Jul 6, 2020
Copy link

@suokko suokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few questions and proposals for improvements.

import sys
import os
sys.path.append('os.getcwd()/python-libs')
sys.path.append('/usr/lib/python3.7')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding default python library path doesn't seem correct.


import sys
import os
sys.path.append('os.getcwd()/python-libs')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a relative path required?

@@ -1,14 +1,23 @@
FROM python:3.7-stretch
FROM python:3.7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would explicitly specify the os using 3.7-buster. This makes sure we have a stable base os which changes only when we specify it in the image build.

Comment on lines +3 to +7
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.7 \
python3-pip \
python3-flask
# python3.7-venv
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I python is available in the image. It is built from the sources. If we want to use the packaged version then we should use a different base image.


ENV FLASK_APP "api.py"
RUN pip3 install -r requirements.txt --upgrade
RUN pip3 install setuptools --upgrade
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is setuptools installed separately?

Comment on lines +26 to +27
libdds/.git:
git submodule update --init
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no submodules which means the submodule target should be dropped.

pytz==2020.1
six==1.15.0
Werkzeug==1.0.1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a belief that Wekzeug is a required dependency for flask. Is that correct?

Comment on lines -6 to +4
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
aniso8601==8.0.0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requirements.txt is supposed to hold versions for implicit dependencies too. I can see how that helps avoid random bugs from upgrading a library without noticing.

I would be happy to use dependencies without versions too. That would be a useful way for development if we have over 95% test coverage. The high test coverage would then allow us catch any surprise bugs from library upgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants