Skip to content

Commit

Permalink
Galaxy (#40)
Browse files Browse the repository at this point in the history
* fix

* make galaxy tools prototype

* galaxy tool PR; container 4 galaxy mode

* allow clean settings (no components)

* no pr if exist

* fix str + bytes

* PR name

* move logger.info components

* galaxy requirements already merged

* betetr naming

* fix

* version from master

* fix tool id not allowed symbols

* write last commit even if not changed

* cleanup before generation

* .shed.yml generation

* fix typo

* continue next repo if exception

* shed repo name is tool_id

* gitlab commit link in comment

* fix filenotfound on new tool cleanup

* reduce long lines and duplication

* main nb2workflow in Dockerfile_galaxy

* build galaxy bot action

* branch name in tag for pr in action

* action triggers

* proper if in action
  • Loading branch information
dsavchenko authored Feb 27, 2024
1 parent 90a36f5 commit 2c955da
Show file tree
Hide file tree
Showing 6 changed files with 400 additions and 38 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/docker-image-galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image for Galaxy bot

on:
push:
branches:
- master
pull_request:
types:
- labeled
- opened
- synchronize
- reopened



jobs:
push_to_registry:
name: Push Docker image to Docker Hub
if: contains( github.event.pull_request.labels.*.name, 'galaxy')
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: odahub/odabot-galaxy
tags: |
type=raw,value={{sha}}-{{date 'YYMMDDHHmmss'}}-${{ github.head_ref || github.ref_name }}
- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile_galaxy
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM python:3.9

COPY . /source

RUN pip install -r /source/requirements.txt && pip install /source && rm -r /source
RUN pip install -r /source/requirements.txt && pip install /source[k8sdeploy] && rm -r /source

RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" &&\
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && rm ./kubectl
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile_galaxy
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.9

COPY . /source

# RUN pip install git+https://github.com/oda-hub/nb2workflow@master#egg=nb2workflow[galaxy]
RUN pip install /source[galaxy] && rm -r /source

# Add Tini
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]

CMD ["odabot", "--settings", "/settings.toml", "make-galaxy-tools", "--loop", "10"]
Loading

0 comments on commit 2c955da

Please sign in to comment.