Skip to content

Commit

Permalink
Merge pull request #2 from SkywardAI/feat/yeager
Browse files Browse the repository at this point in the history
Add image and CI
  • Loading branch information
Aisuko authored Jul 18, 2024
2 parents d03d1ad + 1146bb6 commit 1e2cd8f
Show file tree
Hide file tree
Showing 10 changed files with 256 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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
47 changes: 47 additions & 0 deletions .github/workflows/linter-and-builder.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
38 changes: 38 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -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 }}
51 changes: 51 additions & 0 deletions .github/workflows/release-image.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"]
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# yeager
# 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.
28 changes: 28 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -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

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tensorboard==2.17.0
# https://github.com/tensorflow/tensorboard/issues/6874
tb-nightly==2.18.0a20240717

0 comments on commit 1e2cd8f

Please sign in to comment.