-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #384 from bugout-dev/setup-requirements
Setup instead of requirements.txt
- Loading branch information
Showing
51 changed files
with
452 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release mooncrawl package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'mooncrawl/v*' | ||
|
||
defaults: | ||
run: | ||
working-directory: crawlers/mooncrawl | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[distribute] | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release moonstreamapi package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'moonstreamapi/v*' | ||
|
||
defaults: | ||
run: | ||
working-directory: backend | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[distribute] | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Release moonstreamdb package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'moonstreamdb/v*' | ||
|
||
defaults: | ||
run: | ||
working-directory: db | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[distribute] | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
backend/deploy/moonstream.service → backend/deploy/moonstreamapi.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
[Unit] | ||
Description=moonstream-service | ||
Description=moonstreamapi-service | ||
After=network.target | ||
|
||
[Service] | ||
User=ubuntu | ||
Group=www-data | ||
WorkingDirectory=/home/ubuntu/moonstream/backend | ||
EnvironmentFile=/home/ubuntu/moonstream-secrets/app.env | ||
ExecStart=/home/ubuntu/moonstream-env/bin/uvicorn --host 0.0.0.0 --port 7481 --workers 8 moonstream.api:app | ||
SyslogIdentifier=moonstream | ||
ExecStart=/home/ubuntu/moonstream-env/bin/uvicorn --host 0.0.0.0 --port 7481 --workers 8 moonstreamapi.api:app | ||
SyslogIdentifier=moonstreamapi | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Update nodes connection address environment variables | ||
# from AWS Route53 internal hosted zone | ||
|
||
VERSION='0.0.1' | ||
|
||
# Colors | ||
C_RESET='\033[0m' | ||
C_RED='\033[1;31m' | ||
C_GREEN='\033[1;32m' | ||
C_YELLOW='\033[1;33m' | ||
|
||
# Logs | ||
PREFIX_INFO="${C_GREEN}[INFO]${C_RESET} [$(date +%d-%m\ %T)]" | ||
PREFIX_WARN="${C_YELLOW}[WARN]${C_RESET} [$(date +%d-%m\ %T)]" | ||
PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]" | ||
|
||
# Print help message | ||
function usage { | ||
echo "Usage: $0 [-h] -p PRODUCT -f FILEPATH" | ||
echo | ||
echo "CLI to update nodes connection address environment | ||
variables from AWS Route53 internal hosted zone" | ||
echo | ||
echo "Optional arguments:" | ||
echo " -h Show this help message and exit" | ||
echo " -f File path where environment variables update at" | ||
} | ||
|
||
file_flag="" | ||
verbose_flag="false" | ||
|
||
while getopts 'f:v' flag; do | ||
case "${flag}" in | ||
f) file_flag="${OPTARG}" ;; | ||
h) usage | ||
exit 1 ;; | ||
v) verbose_flag="true" ;; | ||
*) usage | ||
exit 1 ;; | ||
esac | ||
done | ||
|
||
# Log messages | ||
function verbose { | ||
if [ "${verbose_flag}" == "true" ]; then | ||
echo -e "$1" | ||
fi | ||
} | ||
|
||
# File flag should be specified | ||
if [ -z "${file_flag}" ]; then | ||
verbose "${PREFIX_CRIT} Please specify file path" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f "${file_flag}" ]; then | ||
verbose "${PREFIX_CRIT} Provided file does not exist" | ||
usage | ||
exit 1 | ||
fi | ||
|
||
verbose "${PREFIX_INFO} Script version: v${VERSION}" | ||
|
||
verbose "${PREFIX_INFO} Source environment variables" | ||
. ${file_flag} | ||
|
||
verbose "${PREFIX_INFO} Retrieving Ethereum node address" | ||
RETRIEVED_NODE_ETHEREUM_IPC_ADDR=$(aws route53 list-resource-record-sets --hosted-zone-id "${MOONSTREAM_INTERNAL_HOSTED_ZONE_ID}" --query "ResourceRecordSets[?Name == '${MOONSTREAM_ETHEREUM_WEB3_PROVIDER_URI}.'].ResourceRecords[].Value" | jq -r .[0]) | ||
if [ "$RETRIEVED_NODE_ETHEREUM_IPC_ADDR" == "null" ]; then | ||
verbose "${PREFIX_CRIT} Ethereum node internal DNS record address is null" | ||
exit 1 | ||
fi | ||
|
||
verbose "${PREFIX_INFO} Retrieving Polygon node address" | ||
RETRIEVED_NODE_POLYGON_IPC_ADDR=$(aws route53 list-resource-record-sets --hosted-zone-id "${MOONSTREAM_INTERNAL_HOSTED_ZONE_ID}" --query "ResourceRecordSets[?Name == '${MOONSTREAM_POLYGON_WEB3_PROVIDER_URI}.'].ResourceRecords[].Value" | jq -r .[0]) | ||
if [ "$RETRIEVED_NODE_POLYGON_IPC_ADDR" == "null" ]; then | ||
verbose "${PREFIX_CRIT} Polygon node internal DNS record address is null" | ||
exit 1 | ||
fi | ||
|
||
# TODO(kompotkot): Modify regexp to work with export prefix | ||
verbose "${PREFIX_INFO} Updating MOONSTREAM_NODE_ETHEREUM_IPC_ADDR with ${RETRIEVED_NODE_ETHEREUM_IPC_ADDR}" | ||
sed -i "s|^MOONSTREAM_NODE_ETHEREUM_IPC_ADDR=.*|MOONSTREAM_NODE_ETHEREUM_IPC_ADDR=\"$RETRIEVED_NODE_ETHEREUM_IPC_ADDR\"|" ${file_flag} | ||
|
||
verbose "${PREFIX_INFO} Updating MOONSTREAM_NODE_POLYGON_IPC_ADDR with ${RETRIEVED_NODE_POLYGON_IPC_ADDR}" | ||
sed -i "s|^MOONSTREAM_NODE_POLYGON_IPC_ADDR=.*|MOONSTREAM_NODE_POLYGON_IPC_ADDR=\"$RETRIEVED_NODE_POLYGON_IPC_ADDR\"|" ${file_flag} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
try: | ||
from .reporter import reporter | ||
from .version import MOONSTREAMAPI_VERSION | ||
|
||
# Reporting | ||
reporter.tags.append(f"version:{MOONSTREAMAPI_VERSION}") | ||
reporter.system_report(publish=True) | ||
reporter.setup_excepthook(publish=True) | ||
except: | ||
# Pass it to be able import MOONSTREAMAPI_VERSION in setup.py with pip | ||
pass |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.