Isolate stage, testnet and krasnodar (#37)

* Isolate stage, testnet and krasnodar

* Use one node as bootstrap

* Fix json format

* Setup ssh-agent inside deploy container

Workaround for `Needed to prompt for a connection or sudo password, but input would be ambiguous in parallel mode`

* Add private key of any format

* Cleanup

* List available command by default when no CMD provided

* explain --list

Co-authored-by: folex <0xdxdy@gmail.com>
This commit is contained in:
Anatoly Laskaris 2022-06-20 16:46:12 +03:00 committed by GitHub
parent 59e61f97d5
commit 3c04c06228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 62 deletions

View File

@ -1,11 +1,13 @@
from python:2-alpine as BUILD
FROM python:2-alpine as BUILD
RUN apk add gcc musl-dev libffi-dev rust cargo make openssl-dev
copy ./requirements.txt ./requirements.txt
COPY ./requirements.txt ./requirements.txt
RUN pip install --user -r requirements.txt
from python:2-alpine
copy --from=BUILD /root/.local /root/.local
copy . /deploy
env PATH=/root/.local/bin:$PATH
workdir /deploy
ENTRYPOINT ["fab"]
FROM python:2-alpine
RUN apk --no-cache add openssh-client
COPY --from=BUILD /root/.local /root/.local
COPY . /deploy
ENV PATH=/root/.local/bin:$PATH
WORKDIR /deploy
ENTRYPOINT ["/deploy/entrypoint.sh"]
CMD ["--list"] # execute `fab --list` by default

View File

@ -7,29 +7,7 @@
"container_tag": "v0.0.48_46",
"containers_per_host": 1,
"external_bootstraps": [
"/ip4/164.90.171.139/tcp/7770",
"/ip4/164.90.171.139/tcp/7001",
"/ip4/178.128.194.190/tcp/7001",
"/ip4/46.101.159.139/tcp/7001",
"/ip4/161.35.222.178/tcp/7001",
"/ip4/164.90.164.229/tcp/7001",
"/ip4/164.90.168.55/tcp/7001",
"/ip4/161.35.212.85/tcp/7001",
"/ip4/164.90.165.150/tcp/7001",
"/ip4/164.90.172.126/tcp/7001",
"/ip4/164.90.171.156/tcp/7001",
"/ip4/165.227.164.206/tcp/7770",
"/ip4/165.227.164.206/tcp/7001",
"/ip4/138.197.189.50/tcp/7001",
"/ip4/157.230.23.49/tcp/7001",
"/ip4/159.65.126.102/tcp/7001",
"/ip4/142.93.169.49/tcp/7001",
"/ip4/139.59.148.53/tcp/7001",
"/ip4/206.81.30.129/tcp/7001",
"/ip4/157.230.98.51/tcp/7001",
"/ip4/159.89.2.70/tcp/7001",
"/ip4/157.230.98.75/tcp/7001"
"/ip4/164.90.171.139/tcp/7770"
],
"hosts": [
"164.90.171.139",
@ -92,6 +70,7 @@
"container_tag": "v0.0.48_46",
"containers_per_host": 1,
"external_bootstraps": [
"/ip4/165.227.164.206/tcp/7770"
],
"hosts": [
"165.227.164.206",
@ -159,36 +138,7 @@
"user": "root",
"bootstrap": "134.209.186.43",
"external_bootstraps": [
"/ip4/164.90.171.139/tcp/7770",
"/ip4/164.90.171.139/tcp/7001",
"/ip4/178.128.194.190/tcp/7001",
"/ip4/46.101.159.139/tcp/7001",
"/ip4/161.35.222.178/tcp/7001",
"/ip4/164.90.164.229/tcp/7001",
"/ip4/164.90.168.55/tcp/7001",
"/ip4/161.35.212.85/tcp/7001",
"/ip4/164.90.165.150/tcp/7001",
"/ip4/164.90.172.126/tcp/7001",
"/ip4/164.90.171.156/tcp/7001",
"/ip4/165.227.164.206/tcp/7770",
"/ip4/165.227.164.206/tcp/7001",
"/ip4/138.197.189.50/tcp/7001",
"/ip4/157.230.23.49/tcp/7001",
"/ip4/159.65.126.102/tcp/7001",
"/ip4/142.93.169.49/tcp/7001",
"/ip4/139.59.148.53/tcp/7001",
"/ip4/206.81.30.129/tcp/7001",
"/ip4/157.230.98.51/tcp/7001",
"/ip4/159.89.2.70/tcp/7001",
"/ip4/157.230.98.75/tcp/7001",
"/ip4/134.209.186.43/tcp/7770",
"/ip4/134.209.186.43/tcp/7001",
"/ip4/134.209.186.43/tcp/7002",
"/ip4/134.209.186.43/tcp/7003",
"/ip4/134.209.186.43/tcp/7004",
"/ip4/134.209.186.43/tcp/7005"
"/ip4/134.209.186.43/tcp/7770"
],
"management_key": "12D3KooWFRgVmb1uWcmCbmJqLr8tBQghL6ysSpK2VyE2VZbaQ6wy",
"caddy": [
@ -230,4 +180,4 @@
}
}
]
}
}

12
fluence/deploy/entrypoint.sh Executable file
View File

@ -0,0 +1,12 @@
#! /usr/bin/env sh
if ! [[ -d /root/.ssh ]]; then
echo "Private key at '/root/.ssh' is missing or not readable"
echo "Did you forget to mount .ssh directory with '-v $HOME/.ssh:/root/.ssh:ro'?"
exit 1
fi
eval $(ssh-agent) > /dev/null
ssh-add
exec fab $@