Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Commit

Permalink
Minor improvements. Prepares v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tlex committed Jan 26, 2020
1 parent 9ae7ee4 commit d8df1be
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 20 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
.local
14 changes: 1 addition & 13 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
variables:
DOCKER_DRIVER: overlay2
DOCKERHUB_REPO_PREFIX: ixdotai
DOCKERHUB_REPO_NAME: stellar-exporter
ENABLE_ARM64: 'true'
ENABLE_ARMv7: 'true'
ENABLE_ARMv6: 'true'

include:
- project: 'ix.ai/ci-templates'
file: '/python-project.yml'

test:
extends:
- .tags-template
stage: test
image: python:latest
variables:
TEST: 'true'
script:
- pip3 install --no-cache-dir -r src/requirements.txt
- python3 src/${CI_PROJECT_NAME}.py
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /app
COPY src/ /app

RUN apk --no-cache upgrade && \
apk add --no-cache python3 py3-toml py3-numpy py3-prometheus-client py3-pynacl py3-urllib3 && \
apk add --no-cache python3 py3-toml py3-numpy py3-prometheus-client py3-pynacl py3-urllib3 py3-yarl && \
apk add --no-cache python3-dev gcc musl-dev libffi-dev make && \
pip3 install --no-cache-dir -r requirements.txt && \
apk del --no-cache --purge python3-dev gcc musl-dev libffi-dev make
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ docker run --rm -it -p 9308:9308 \

## Tags and Arch

Starting with version v0.4.0, the images are multi-arch, with builds for amd64, arm64 and armv7.
Starting with version v0.4.1, the images are multi-arch, with builds for amd64, arm64, armv7 and armv6.
* `vN.N.N` - for example v0.4.0
* `latest` - always pointing to the latest version
* `dev-branch` - the last build on a feature/development branch
* `dev-master` - the last build on the master branch

## Resources:
Expand Down
4 changes: 2 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pbkdf2
prometheus_client>=0.7.1
pygelf
stellar-base==1.1.2.0
stellar-sdk==2.1.0
toml>=0.10.0
pygelf==0.3.6
pbkdf2
6 changes: 4 additions & 2 deletions src/stellar-exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
datefmt='%Y-%m-%d %H:%M:%S'
)

FILENAME = os.path.splitext(sys.modules['__main__'].__file__)[0]


def configure_logging():
""" Configures the logging """
Expand All @@ -29,7 +31,7 @@ def configure_logging():
port=int(os.environ.get('GELF_PORT', 12201)),
debug=True,
include_extra_fields=True,
_ix_id=os.path.splitext(sys.modules['__main__'].__file__)[0][1:], # sets it to 'stellar-exporter'
_ix_id=FILENAME
)
LOG.addHandler(GELF)
gelf_enabled = True
Expand Down Expand Up @@ -102,7 +104,7 @@ def collect(self):
configure_logging()
PORT = int(os.environ.get('PORT', 9188))
# pylint: disable=no-member
LOG.info("Starting stellar-exporter {} on port {}".format(constants.VERSION, PORT))
LOG.info("Starting {} {} on port {}".format(FILENAME, constants.VERSION, PORT))
REGISTRY.register(StellarCollector())
TEST = os.environ.get('TEST', False)
if not TEST:
Expand Down
3 changes: 3 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

TEST=true python3 src/${CI_PROJECT_NAME}.py

0 comments on commit d8df1be

Please sign in to comment.