-
-
Notifications
You must be signed in to change notification settings - Fork 124
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 #171 from hummingbot/development
sync / Dashboard development -> main
- Loading branch information
Showing
108 changed files
with
694 additions
and
117,028 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,80 @@ | ||
name: Build and Push Docker image | ||
name: Dashboard Docker Buildx Workflow | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
- development | ||
release: | ||
types: [published, edited] | ||
|
||
jobs: | ||
build: | ||
build_pr: | ||
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged == true | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3.5.3 | ||
uses: actions/checkout@v4.1.1 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2.2.0 | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
with: | ||
version: latest | ||
uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2.2.0 | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
id: docker_build | ||
uses: docker/[email protected] | ||
- name: Build and push Development Image | ||
if: github.base_ref == 'development' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: hummingbot/dashboard:development | ||
|
||
- name: Build and push Latest Image | ||
if: github.base_ref == 'main' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: hummingbot/dashboard:latest | ||
|
||
build_release: | ||
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/[email protected] | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Extract tag name | ||
id: get_tag | ||
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
build-args: | | ||
BRANCH=${{ github.ref }} | ||
COMMIT=${{ github.sha }} | ||
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
cache-from: type=registry,ref=hummingbot/dashboard:latest | ||
cache-to: type=inline | ||
|
||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} | ||
push: true | ||
tags: hummingbot/dashboard:${{ steps.get_tag.outputs.VERSION }} |
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,33 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: detect-private-key | ||
|
||
- repo: https://github.com/pre-commit/mirrors-eslint | ||
rev: v8.10.0 | ||
hooks: | ||
- id: eslint | ||
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx | ||
types: [file] | ||
|
||
- repo: https://github.com/CoinAlpha/git-hooks | ||
rev: 78f0683233a09c68a072fd52740d32c0376d4f0f | ||
hooks: | ||
- id: detect-wallet-private-key | ||
types: [file] | ||
exclude: .json | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
files: "\\.(py)$" | ||
args: [--settings-path=pyproject.toml] | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: ['flake8'] | ||
args: [--max-line-length=130] |
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 |
---|---|---|
@@ -1,19 +1,49 @@ | ||
.ONESHELL: | ||
.SHELLFLAGS := -c | ||
|
||
.PHONY: run | ||
.PHONY: uninstall | ||
.PHONY: install | ||
.PHONY: install-pre-commit | ||
.PHONY: docker_build | ||
.PHONY: docker_run | ||
|
||
|
||
detect_conda_bin := $(shell bash -c 'if [ "${CONDA_EXE} " == " " ]; then \ | ||
CONDA_EXE=$$((find /opt/conda/bin/conda || find ~/anaconda3/bin/conda || \ | ||
find /usr/local/anaconda3/bin/conda || find ~/miniconda3/bin/conda || \ | ||
find /root/miniconda/bin/conda || find ~/Anaconda3/Scripts/conda || \ | ||
find $$CONDA/bin/conda) 2>/dev/null); fi; \ | ||
if [ "${CONDA_EXE}_" == "_" ]; then \ | ||
echo "Please install Anaconda w/ Python 3.10+ first"; \ | ||
echo "See: https://www.anaconda.com/distribution/"; \ | ||
exit 1; fi; \ | ||
echo $$(dirname $${CONDA_EXE})') | ||
|
||
CONDA_BIN := $(detect_conda_bin) | ||
|
||
run: | ||
streamlit run main.py | ||
streamlit run main.py --server.headless true | ||
|
||
uninstall: | ||
conda env remove -n dashboard | ||
|
||
install: | ||
conda env create -f environment_conda.yml | ||
if conda env list | grep -q '^dashboard '; then \ | ||
echo "Environment already exists."; \ | ||
else \ | ||
conda env create -f environment_conda.yml; \ | ||
fi | ||
$(MAKE) install-pre-commit | ||
|
||
install-pre-commit: | ||
/bin/bash -c 'source "${CONDA_BIN}/activate" dashboard && \ | ||
if ! conda list pre-commit | grep pre-commit &> /dev/null; then \ | ||
pip install pre-commit; \ | ||
fi && pre-commit install' | ||
|
||
docker_build: | ||
docker build -t hummingbot/dashboard:latest . | ||
|
||
docker_run: | ||
docker run -p 8501:8501 dashboard:latest | ||
docker run -p 8501:8501 hummingbot/dashboard:latest |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import pandas as pd | ||
import requests | ||
from glom import * | ||
from glom import glom | ||
|
||
|
||
class MinerClient: | ||
|
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 |
---|---|---|
@@ -1,13 +1,14 @@ | ||
cookie: | ||
expiry_days: 30 | ||
key: random_signature_key | ||
name: random_cookie_name | ||
credentials: | ||
usernames: | ||
admin: | ||
email: [email protected] | ||
name: Admin User | ||
password: abc # To be replaced with hashed password: hashed_passwords = stauth.Hasher(['abc', 'def']).generate() | ||
preauthorized: # the preferred way to add users since there is no need for manual hashing of passwords | ||
logged_in: False | ||
password: abc | ||
cookie: | ||
expiry_days: 0 | ||
key: some_signature_key # Must be string | ||
name: some_cookie_name | ||
pre-authorized: | ||
emails: | ||
- [email protected] |
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
Oops, something went wrong.