diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..14dc503 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,38 @@ +name-template: 'v$RESOLVED_VERSION 🌈' +tag-template: 'v$RESOLVED_VERSION' +categories: + - title: 'πŸš€ Features' + labels: + - 'enhancement' + - 'feature' + - title: 'πŸ› Bug Fixes' + labels: + - 'bugfix' + - 'fix' + - 'bug' + - title: '🧰 Maintenance' + label: + - 'ci' + - 'refactor' + - 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' +version-resolver: + major: + labels: + - 'major' + minor: + labels: + - 'minor' + patch: + labels: + - 'patch' + default: patch +template: | + ## What's New + $CHANGES + + ## Contributors + + Thank you to our contributors for making this release possible: + $CONTRIBUTORS diff --git a/.github/workflows/linter-and-builder.yaml b/.github/workflows/linter-and-builder.yaml new file mode 100644 index 0000000..91dd8d5 --- /dev/null +++ b/.github/workflows/linter-and-builder.yaml @@ -0,0 +1,47 @@ +name: 'Builder Checker πŸš€' +on: + pull_request: + branches: + - 'main' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + check-build-images: + name: 'Docker Build Checker🐳' + strategy: + matrix: + config: + - { dockerfile: "Dockerfile", platforms: "linux/amd64,linux/arm64" } + # defaults: + # run: + # working-directory: backend/ + runs-on: ubuntu-latest + steps: + + - name: Check repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Get Commit Hash + id: commit + shell: bash + run: | + echo "SHORT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV + + - name: Build Docker image + # if: startsWith(github.ref, 'refs/tags/') != true && success() + uses: docker/build-push-action@v6 + with: + context: backend/ + push: false + platforms: ${{ matrix.config.platforms }} + tags: "${{ secrets.YEAGER_REPO }}/${{ secrets.YEAGER_NAME }}:${{ env.SHORT_HASH }}" + file: ${{ matrix.config.dockerfile }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..970e6e8 --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,38 @@ +name: 'Release Drafter πŸš€' + +on: + push: + # branches to consider in the event; optional, defaults to all + branches: + - main + # pull_request event is required only for autolabeler + pull_request: + # Only following types are handled by the action, but one can default to all as well + types: [opened, reopened, synchronize] + # pull_request_target event is required for autolabeler to support PRs from forks + # pull_request_target: + # types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + # write permission is required to create a github release + contents: write + # write permission is required for autolabeler + # otherwise, read permission is required at least + pull-requests: write + runs-on: ubuntu-latest + steps: + # Drafts your next Release notes as Pull Requests are merged into "master" + - uses: release-drafter/release-drafter@v6 + # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml + with: + config-name: release-drafter.yml + # https://github.com/release-drafter/release-drafter/issues/1125 + commitish: main + # disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-image.yaml b/.github/workflows/release-image.yaml new file mode 100644 index 0000000..d211302 --- /dev/null +++ b/.github/workflows/release-image.yaml @@ -0,0 +1,51 @@ +name: 'Releasing Image πŸš€' +on: + push: + tags: + - 'v*' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + release_image: + name: 'Releasing Image 🐳' + strategy: + matrix: + config: + - { dockerfile: "Dockerfile", platforms: "linux/amd64,linux/arm64" } + runs-on: ubuntu-latest + steps: + - name: Check repository + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Tag Name + id: tag + shell: bash + run: | + echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Release Docker image + if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success() + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: ${{ matrix.config.platforms }} + tags: "ghcr.io/${{ secrets.SKYWARD_GITHUB }}/${{ secrets.YEAGER_NAME }}:${{ env.TAG }}" + file: ${{ matrix.config.dockerfile }} diff --git a/.gitignore b/.gitignore index 82f9275..4c7fdd5 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,5 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + +volumes/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index a687e84..13194f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,16 @@ +# Copyright [2024] [SkywardAI] +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM python:3.11.8-slim WORKDIR /app @@ -8,5 +21,3 @@ ENV PYTHONUNBUFFERED 1 COPY requirements.txt . RUN pip --disable-pip-version-check --no-cache-dir install -r requirements.txt && rm -rf /tmp/pip-tmp - -ENTRYPOINT ["tensorboard", "--logdir=runs"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e787703 --- /dev/null +++ b/Makefile @@ -0,0 +1,23 @@ +FILE_NAME:=.env + +DOCKER_VOLUME_DIRECTORY:= +METRICS_PATHS:=runs + +.PHONY: env +env: + @echo "DOCKER_VOLUME_DIRECTORY=$(DOCKER_VOLUME_DIRECTORY)" > $(FILE_NAME) + @echo "METRICS_PATHS=$(METRICS_PATHS)" >> $(FILE_NAME) + +.PHONY: build +build: env + @docker compose -f docker-compose.yaml build + + +.PHONY: up +up: build + @docker compose -f docker-compose.yaml up -d + + +.PHONY: stop +stop: + @docker compose -f docker-compose.yaml stop diff --git a/README.md b/README.md index a0e6ab4..ebc3dc5 100644 --- a/README.md +++ b/README.md @@ -1 +1,14 @@ -# yeager \ No newline at end of file +# yeager + + +Visualization model and training process. + + +# Acknowledgement + +* [Tensorboard](https://www.tensorflow.org/tensorboard) + + +# LICENSE + +This project is licensed under the terms of the Apache 2.0 license. See the [LICENSE](./LICENSE) file. \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..a912f90 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,28 @@ +# Copyright [2024] [SkywardAI] +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +services: + yeager: + container_name: yeager + restart: always + build: + dockerfile: Dockerfile + context: . + entrypoint: ["python3", "-m", "tensorboard.main","--bind_all","--logdir=${METRICS_PATHS}"] + volumes: + - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/runs:/app/runs + expose: + - 6006 + ports: + - 6006:6006 + diff --git a/requirements.txt b/requirements.txt index ec8d0b4..a13f6f8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -tensorboard==2.17.0 \ No newline at end of file +# https://github.com/tensorflow/tensorboard/issues/6874 +tb-nightly==2.18.0a20240717 \ No newline at end of file