Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: cleanup topos tools (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
atanmarko authored Dec 20, 2023
1 parent 6e72999 commit 0820306
Show file tree
Hide file tree
Showing 23 changed files with 20 additions and 1,595 deletions.
78 changes: 0 additions & 78 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,6 @@ jobs:
uses: ./.github/workflows/docker_utils.yml
secrets: inherit

network:
uses: ./.github/workflows/docker_utils.yml
secrets: inherit

docker_e2e:
runs-on: ubuntu-latest-16-core
needs: docker
if: ${{ github.event_name == 'pull_request' }}
env:
EXPECTED_IMAGE_NAME: ghcr.io/${{ github.repository }}:main
steps:
- name: Set environment
run: |
# It's fine to assume a single tag. Our tagging strategy follows a 1:1 mapping of image:tag
tags=${{ needs.docker.outputs.tags }}
echo "docker_tag=${tags#*:}" >> $GITHUB_ENV
shell: bash

- name: Setup image to match docker-compose file
run: |
docker pull ghcr.io/${{ github.repository}}:${{ env.docker_tag }}
docker tag ghcr.io/${{ github.repository}}:${{ env.docker_tag }} ${{ env.EXPECTED_IMAGE_NAME }}
- name: Checkout
uses: actions/checkout@v4

- name: Running TCE cluster
run: |
docker compose -f tools/docker-compose.yml up -d peer
- name: Checking for healthy cluster
uses: nick-fields/[email protected]
with:
retry_on: error
max_attempts: 5
retry_wait_seconds: 40
timeout_minutes: 10
on_retry_command: docker inspect --format "{{ .Name }} {{ .State.Health.Status }}" $(docker compose -f tools/docker-compose.yml ps -aq peer boot) | grep "healthy$" | cut -d ' ' -f 1 | xargs -I{} sh -c 'echo "\nLogs for => {}\n" && docker logs {}'
command: |
EXPECTED=$(docker compose -f tools/docker-compose.yml ps -aq peer boot|wc -l)
COUNT=$(docker inspect --format "{{.State.Health.Status }}" $(docker compose -f tools/docker-compose.yml ps -aq peer boot)|grep "^healthy$"|wc -l)
echo "Number of Healthy containers: $COUNT"
if [[ $COUNT -eq $EXPECTED ]]; then
echo "All expected containers healthy"
exit 0
else
echo "Unhealthy containers"
docker compose -f tools/docker-compose.yml ps -a peer boot
exit 1
fi
- name: Run the check
run: |
docker compose -f tools/docker-compose.yml ps
docker compose -f tools/docker-compose.yml run --no-deps check
integration-erc20-e2e:
runs-on: ubuntu-latest
needs: docker
Expand All @@ -94,25 +38,3 @@ jobs:
ref: main
wait_interval: 60
client_payload: '{ "topos-docker-tag": "${{ env.docker_tag }}" }'

frontend-erc20-e2e:
runs-on: ubuntu-latest
needs: docker
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Set environment
run: |
# It's fine to assume a single tag. Our tagging strategy follows a 1:1 mapping of image:tag
tags=${{ needs.docker.outputs.tags }}
echo "docker_tag=${tags#*:}" >> $GITHUB_ENV
shell: bash

- uses: convictional/[email protected]
with:
owner: topos-protocol
repo: e2e-tests
github_token: ${{ secrets.ROBOT_PAT_TRIGGER_E2E_WORKFLOWS }}
workflow_file_name: frontend:erc20-messaging.yml
ref: main
wait_interval: 60
client_payload: '{ "topos-docker-tag": "${{ env.docker_tag }}" }'
2 changes: 1 addition & 1 deletion .github/workflows/docker_utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
secret-files: |
"aws=${{ github.workspace }}/.aws/credentials"
build-args: |
TOOLCHAIN_VERSION=${{ inputs.toolchain_version }}
RUSTUP_TOOLCHAIN=${{ inputs.toolchain_version }}
SCCACHE_S3_KEY_PREFIX=${{ inputs.target }}
SCCACHE_BUCKET=cicd-devnet-1-sccache
SCCACHE_REGION=us-east-1
Expand Down
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG TOOLCHAIN_VERSION
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/topos-protocol/rust_builder:bullseye-${TOOLCHAIN_VERSION} AS base
ARG RUSTUP_TOOLCHAIN=stable
FROM --platform=${BUILDPLATFORM:-linux/amd64} ghcr.io/topos-protocol/rust_builder:bullseye-${RUSTUP_TOOLCHAIN} AS base

ARG FEATURES
# Rust cache
Expand Down Expand Up @@ -28,8 +28,6 @@ ENV PATH="${PATH}:/usr/src/app"
WORKDIR /usr/src/app

COPY --from=build /usr/src/app/target/release/topos .
COPY tools/init.sh ./init.sh
COPY tools/liveness.sh /tmp/liveness.sh

RUN apt-get update && apt-get install -y \
ca-certificates \
Expand All @@ -40,4 +38,4 @@ RUN apt-get update && apt-get install -y \
RUN mkdir /tmp/node_config
RUN mkdir /tmp/shared

ENTRYPOINT ["./init.sh"]
ENTRYPOINT ["./topos"]
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,25 @@ topos --help

Find more about how topos works in the [documentation](https://docs.topos.technology/).

### Topos Docker image

The docker images use `stable` Rust toolchain by default. You can use a different one by defining `RUSTUP_TOOLCHAIN` argument, the list of available toolchain is [here](https://github.com/topos-protocol/topos-ci-docker/pkgs/container/rust_builder)

Build Topos docker image:

```
DOCKER_BUILDKIT=1 docker build . --build-arg RUSTUP_TOOLCHAIN=[...] -t topos:latest
```
Run Topos docker image:

```
docker run -it --rm topos:latest --help
```


## Development

Contributions are very welcomed, the guidelines are outlined in [`CONTRIBUTING.md`](https://github.com/topos-protocol/.github/blob/main/CONTRIBUTING.md).<br />
Running a minimal local setup with docker compose is described [here](./tools/README.md).

## Support

Expand Down
File renamed without changes.
45 changes: 0 additions & 45 deletions tools/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions tools/config/grafana/config.monitoring

This file was deleted.

Loading

0 comments on commit 0820306

Please sign in to comment.