-
Notifications
You must be signed in to change notification settings - Fork 27
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
Aryeh/rpc-auth #36
Aryeh/rpc-auth #36
Changes from all commits
6fee28f
dec7345
20bc5ea
1b022e3
e438a41
f65b18f
fb83b1b
8d2632c
f0d2f3b
e8687d3
f1da427
8a604b2
14b7034
c31ff23
8c3b8e1
806870a
95ca56e
f7279aa
8fe6e8c
f9ce69f
853cbd7
f4ed012
224dc90
1734ba1
de28627
a1534f2
9f528dc
be1272e
8a457be
0a8addc
4b2dfff
cffc113
cd78851
6e82a3c
07a6340
074e7b5
b416cb3
7edf679
9698c6a
d509484
ec6cbd8
9ea611d
a5b8c4c
d500c4a
5357394
32c098f
635b952
64e2de2
7fca9ae
eec82f1
22c25d6
3a0a70f
e1361e8
c9a2ef8
38dde33
97d618a
3ca2c86
bf55629
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,9 @@ dist | |
*.pyc | ||
*.egg-info | ||
.venv* | ||
.DS_Store | ||
build | ||
.devspace/ | ||
mkchain-devspace.yaml | ||
/*_chain.yaml | ||
/*_chain_invite.yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
FROM python:3.9-slim as builder | ||
|
||
RUN mkdir -p /var/rpc-auth/ | ||
|
||
WORKDIR /var/rpc-auth/ | ||
|
||
# Installing pytezos deps | ||
RUN apt-get update -y \ | ||
&& apt-get install --no-install-recommends -y \ | ||
automake \ | ||
build-essential \ | ||
libffi-dev \ | ||
libgmp-dev \ | ||
libsecp256k1-dev \ | ||
libsodium-dev \ | ||
libtool \ | ||
pkg-config \ | ||
&& echo | ||
|
||
COPY requirements.txt . | ||
RUN mkdir wheels \ | ||
&& pip wheel -r requirements.txt \ | ||
--wheel-dir ./wheels --no-cache-dir | ||
|
||
FROM python:3.9-slim AS src | ||
|
||
WORKDIR /var/rpc-auth/ | ||
|
||
# Installing pytezos deps | ||
RUN apt-get update -y \ | ||
&& apt-get install --no-install-recommends -y \ | ||
libffi-dev \ | ||
libgmp-dev \ | ||
libsecp256k1-dev \ | ||
libsodium-dev \ | ||
&& apt-get clean \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Installing python dependencies | ||
COPY --from=builder /var/rpc-auth/wheels wheels | ||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt \ | ||
--no-index --find-links ./wheels \ | ||
&& rm -rf ./wheels ./requirements.txt | ||
|
||
RUN groupadd -g 999 appuser && \ | ||
useradd -r -u 999 -g appuser appuser | ||
|
||
COPY --chown=appuser:appuser ./server/index.py . | ||
|
||
ARG FLASK_ENV=production | ||
ENV FLASK_ENV=$FLASK_ENV | ||
ENV PYTHONUNBUFFERED=x | ||
|
||
EXPOSE 8080 | ||
|
||
USER appuser | ||
|
||
CMD uwsgi \ | ||
--http-socket 0.0.0.0:8080 \ | ||
--callable app \ | ||
--threads 100 \ | ||
--processes 1 \ | ||
--wsgi-file index.py \ | ||
--worker-reload-mercy 0 \ | ||
$(if [ "${FLASK_ENV}" = "development" ] ; then echo "--touch-reload index.py" ; else : ; fi) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that useful considering that devspace will rebuild and restart the container when something changes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nicolasochem looks like devspace is set up to sync files for rpc-auth rather than rebuild image, so this makes sense There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
version: v1beta9 | ||
deployments: | ||
- name: rpc-auth | ||
namespace: tqtezos | ||
kubectl: | ||
manifests: | ||
- ../../tqchain/deployment/rpc-auth.yaml | ||
|
||
images: | ||
rpc-auth: | ||
image: tezos-rpc-auth | ||
dockerfile: ./Dockerfile | ||
context: ./ | ||
build: | ||
docker: | ||
options: | ||
buildArgs: | ||
FLASK_ENV: ${FLASK_ENV} | ||
dev: | ||
logs: | ||
images: | ||
- rpc-auth | ||
sync: | ||
- imageName: rpc-auth | ||
namespace: tqtezos | ||
labelSelector: | ||
app: rpc-auth | ||
localSubPath: ./server | ||
autoReload: | ||
images: | ||
- rpc-auth | ||
deployments: | ||
- rpc-auth | ||
|
||
hooks: | ||
- command: minikube | ||
args: | ||
- addons | ||
- enable | ||
- ingress | ||
when: | ||
before: | ||
deployments: rpc-auth | ||
|
||
vars: | ||
- name: FLASK_ENV # development | production | ||
question: Deployment env to run RPC authentication | ||
default: development | ||
source: env | ||
|
||
dependencies: | ||
- name: chain | ||
source: | ||
path: ../../ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
base58==1.0.3 | ||
bson==0.5.10 | ||
certifi==2020.6.20 | ||
cffi==1.14.3 | ||
chardet==3.0.4 | ||
click==7.1.2 | ||
fastecdsa==1.7.5 | ||
fire==0.3.1 | ||
Flask==1.1.2 | ||
idna==2.10 | ||
itsdangerous==1.1.0 | ||
Jinja2==2.11.2 | ||
loguru==0.5.3 | ||
MarkupSafe==1.1.1 | ||
mnemonic==0.19 | ||
netstruct==1.1.2 | ||
pendulum==2.1.2 | ||
ply==3.11 | ||
pyblake2==1.1.2 | ||
pycparser==2.20 | ||
pysodium==0.7.5 | ||
pytezos==2.5.11 | ||
python-dateutil==2.8.1 | ||
pytzdata==2020.1 | ||
PyYAML==5.3.1 | ||
redis==3.5.3 | ||
requests==2.24.0 | ||
secp256k1==0.13.2 | ||
simplejson==3.17.2 | ||
six==1.15.0 | ||
termcolor==1.1.0 | ||
tqdm==4.51.0 | ||
urllib3==1.25.11 | ||
uWSGI==2.0.19.1 | ||
Werkzeug==1.0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add a paragraph in DEVELOPMENT.md explaining how to spin up rpc-auth on minikube with devspace.