Skip to content

Commit

Permalink
Merge pull request #27 from PromptSail/dev
Browse files Browse the repository at this point in the history
Documentation, Backend, and Frontend Updates
  • Loading branch information
ksopyla authored Apr 28, 2024
2 parents e03a6dd + 576d766 commit 5466bd7
Show file tree
Hide file tree
Showing 52 changed files with 1,096 additions and 481 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,18 @@ jobs:
- name: Set RELEASE_TAG based on branch name and release tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "RELEASE_TAG=release_candidate" >> $GITHUB_ENV
echo "RELEASE_TAG=release-candidate" >> $GITHUB_ENV
elif [[ "${{ github.event.release.tag_name }}" != "" ]]; then
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
else
echo "RELEASE_TAG=non-release" >> $GITHUB_ENV
echo "RELEASE_TAG=dev-release" >> $GITHUB_ENV
fi
- name: Use RELEASE_TAG
run: echo "RELEASE_TAG is ${{ env.RELEASE_TAG }}"

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4


# Install the cosign tool except on PR
Expand All @@ -117,17 +117,21 @@ jobs:
with:
cosign-release: 'v2.1.1'

# Set up QEMU for cross-platform builds -> https://docs.docker.com/build/ci/github-actions/multi-platform/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 # v3.0.0
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 # v3.0.0
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -145,16 +149,18 @@ jobs:

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
# previous tags
#${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_BACKEND }}:${{ github.sha }}
#${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_BACKEND }}:${{ github.run_number }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5 # v5.0.0
with:
platforms: linux/amd64,linux/arm64
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_BACKEND }}:${{ github.sha }}
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_BACKEND }}:${{ github.run_number }}
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_BACKEND }}:${{ github.event.release.tag_name || env.RELEASE_TAG }}
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_BACKEND }}:${{ env.RELEASE_TAG }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -178,8 +184,6 @@ jobs:





build-publish-ui-image:

runs-on: ubuntu-latest
Expand All @@ -198,17 +202,17 @@ jobs:
- name: Set RELEASE_TAG based on branch name and release tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "RELEASE_TAG=release_candidate" >> $GITHUB_ENV
echo "RELEASE_TAG=release-candidate" >> $GITHUB_ENV
elif [[ "${{ github.event.release.tag_name }}" != "" ]]; then
echo "RELEASE_TAG=latest" >> $GITHUB_ENV
else
echo "RELEASE_TAG=non-release" >> $GITHUB_ENV
echo "RELEASE_TAG=dev-release" >> $GITHUB_ENV
fi
- name: Use RELEASE_TAG
run: echo "RELEASE_TAG is ${{ env.RELEASE_TAG }}"
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4


# Install the cosign tool except on PR
Expand All @@ -219,6 +223,10 @@ jobs:
with:
cosign-release: 'v2.1.1'

# Set up QEMU for cross-platform builds -> https://docs.docker.com/build/ci/github-actions/multi-platform/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
Expand All @@ -245,17 +253,17 @@ jobs:
images: ${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
# ${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}:${{ github.sha }}
# ${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}:${{ github.run_number }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5 # v5.0.0
with:
platforms: linux/amd64,linux/arm64
context: ./ui
file: ./ui/Dockerfile
push: true

tags: |
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}:${{ github.sha }}
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}:${{ github.run_number }}
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}:${{ github.event.release.tag_name || env.RELEASE_TAG }}
${{ env.IMAGE_URI }}/${{ env.IMAGE_NAME_UI }}:${{ env.RELEASE_TAG }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
5 changes: 2 additions & 3 deletions backend/perf_tests/locustfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

class CountStatisticsUser(HttpUser):


# def on_start(self):

# count=1000
Expand Down Expand Up @@ -38,7 +37,6 @@ def transaction_count_statistics_daily(self):
)



class CostStatisticsUser(HttpUser):
# Transaction Cost Statistics
@task
Expand Down Expand Up @@ -79,6 +77,7 @@ def transaction_speed_statistics_monthly(self):
self.client.get(
f"/api/statistics/transactions_speed?project_id={project_id}&period=month"
)

@task
def transaction_speed_statistics_weekly(self):
self.client.get(
Expand All @@ -89,4 +88,4 @@ def transaction_speed_statistics_weekly(self):
def transaction_speed_statistics_daily(self):
self.client.get(
f"/api/statistics/transactions_speed?project_id={project_id}&period=day"
)
)
Loading

0 comments on commit 5466bd7

Please sign in to comment.