Skip to content

Commit

Permalink
Use GitHub Actions (#9)
Browse files Browse the repository at this point in the history
* Create build-container.yml

* Update build-container.yml

* Update build-container.yml

* Update a yml for GitHub Actions

* Update build-container.yml

* Update Dockerfile

* Update cyrest.version

* Update Dockerfile

* Create docker-compose.yml

* Remove Dockerfiles for py4cy and RCy3

* Update docker-compose.yml

* Add fluxbox to Cytoscape Desktop env

* Use .env file to set PORT number or SCREEN size

* Update build-container.yml
  • Loading branch information
kozo2 committed Sep 10, 2023
1 parent 91bb66c commit 2f99afb
Show file tree
Hide file tree
Showing 10 changed files with 118 additions and 119 deletions.
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
NOVNC_PORT=6080
NOVNC_SCREEN_WIDTH=1920
NOVNC_SCREEN_HEIGHT=1080
CYREST_PORT=1234

JUPYTER_PORT=8888
JUPYTER_TOKEN=token
JUPYTER_PASSWORD=password
43 changes: 43 additions & 0 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- 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: cytoscape/cytoscape-desktop

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
12 changes: 7 additions & 5 deletions base/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

# PARAMETERS
ENV CYTOSCAPE_VERSION 3.9.1
ENV CYTOSCAPE_VERSION 3.10.1
ENV TZ=Asia/Tokyo

# CHANGE USER
USER root

# INSTALL JAVA
RUN apt-get update && apt-get -y install default-jdk libxcursor1 xvfb supervisor wget x11vnc novnc websockify
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && apt-get -y install openjdk-17-jdk libxcursor1 xvfb supervisor wget x11vnc novnc websockify fluxbox
RUN wget https://github.com/cytoscape/cytoscape/releases/download/${CYTOSCAPE_VERSION}/cytoscape-unix-${CYTOSCAPE_VERSION}.tar.gz
RUN tar xf cytoscape-unix-${CYTOSCAPE_VERSION}.tar.gz && rm cytoscape-unix-${CYTOSCAPE_VERSION}.tar.gz
RUN cd /cytoscape-unix-${CYTOSCAPE_VERSION}/framework/system/org/cytoscape/property-impl/${CYTOSCAPE_VERSION} \
&& jar -xf property-impl-${CYTOSCAPE_VERSION}.jar cytoscape3.props \
&& cat cytoscape3.props | sed "s/^cyrest.version.*/cyrest.version=3.12.3/g" > cytoscape3.props.tmp \
&& cat cytoscape3.props | sed "s/^cyrest.version.*/cyrest.version=3.13.2/g" > cytoscape3.props.tmp \
&& mv cytoscape3.props.tmp cytoscape3.props \
&& jar -uf property-impl-${CYTOSCAPE_VERSION}.jar cytoscape3.props \
&& rm cytoscape3.props \
&& cd /
# Set JAVA_HOME From sudo update-alternatives --config java
RUN echo 'JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"' >> /etc/environment
RUN echo 'JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"' >> /etc/environment

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]
15 changes: 0 additions & 15 deletions base/supervisord.conf

This file was deleted.

20 changes: 20 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.10.1'
services:

cytoscape-desktop:
image: cytoscape/cytoscape-desktop:3.10.1
ports:
- '${NOVNC_PORT}:${NOVNC_PORT}'
environment:
- XVFB_SCREEN_WIDTH=${NOVNC_SCREEN_WIDTH}
- XVFB_SCREEN_HEIGHT=${NOVNC_SCREEN_HEIGHT}
- NOVNC_PORT=${NOVNC_PORT}
- CYREST_PORT=${CYREST_PORT}

jupyter:
image: jupyter/datascience-notebook
ports:
- '${JUPYTER_PORT}:${JUPYTER_PORT}'
environment:
- JUPYTER_TOKEN=${JUPYTER_TOKEN}
- PASSWORD=${JUPYTER_PASSWORD}
26 changes: 0 additions & 26 deletions py4cytoscape/Dockerfile

This file was deleted.

21 changes: 0 additions & 21 deletions py4cytoscape/supervisord.conf

This file was deleted.

29 changes: 0 additions & 29 deletions rcy3/Dockerfile

This file was deleted.

23 changes: 0 additions & 23 deletions rcy3/supervisord.conf

This file was deleted.

40 changes: 40 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[supervisord]
nodaemon=true

[program:xvfb]
priority=1
directory=/
command=/usr/bin/Xvfb :1 -screen 0 "%(ENV_XVFB_SCREEN_WIDTH)s"x"%(ENV_XVFB_SCREEN_HEIGHT)s"x24 +extension RANDR
user=root
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/xvfb.log
stderr_logfile=/var/log/xvfb.err

[program:x11vnc]
command=/bin/bash -c 'x11vnc -forever -shared -display :1 -auth /root/.Xauth'
priority=11

[program:fluxbox]
priority=20
directory=/root
command=/usr/bin/fluxbox -rc /etc/fluxbox_init
user=root
autostart=true
autorestart=true
stopsignal=TERM
environment=DISPLAY=":1",HOME="/root"
stdout_logfile=/var/log/fluxbox.log
stderr_logfile=/var/log/fluxbox.err

[program:chrome]
priority=30
command=/bin/bash -c 'rm -rf /root/CytoscapeConfiguration && /cytoscape-unix-%(ENV_CYTOSCAPE_VERSION)s/cytoscape.sh --rest %(ENV_CYREST_PORT)s'
user=root
autostart=true
stopsignal=QUIT
environment=DISPLAY=":1",HOME="/root"

[program:novnc]
command=/bin/bash -c 'websockify -D --web=/usr/share/novnc/ %(ENV_NOVNC_PORT)s localhost:5900'

0 comments on commit 2f99afb

Please sign in to comment.