Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Headless Dockerfile & configure GH action to build & push #1908

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Docker

on:
push:
branches:
- master
- develop
- gh-actions-docker # TODO remove before creating a PR
# Skip jobs when only documentation files are changed
paths-ignore:
- '**.md'
- '**.rst'
- '**.db'
- 'docs/**'
pull_request:
paths-ignore:
- '**.md'
- '**.rst'
- '**.db'
- 'docs/**'

env:
AV_VERSION: "8c41c3d2e6b55f8e62e97e52633b38aaff2c7ccf" # Pin to a specific commit or release tag
DOCKER_REGISTRY: "ghcr.io"
REPO_OWNER: ${{ github.repository_owner }}
CUDA_VERSION: "11.8.0"
AV_REPO: "ghcr.io/${{ github.repository_owner }}/alicevision"
MESHROOM_VERSION: ${{ github.event.release.tag_name || github.sha }}

jobs:
ubuntu:
runs-on: ubuntu-latest
env:
UBUNTU_VERSION: "22.04"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Login to registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PUSH_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile_ubuntu_headless
build-args: |
AV_REPO=${{ env.AV_REPO }}
AV_VERSION=${{ env.AV_VERSION }}
CUDA_VERSION=${{ env.CUDA_VERSION }}
UBUNTU_VERSION=${{ env.UBUNTU_VERSION }}
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.REPO_OWNER }}/meshroom-headless:${{ env.MESHROOM_VERSION }}-av${{ env.AV_VERSION }}-ubuntu${{ env.UBUNTU_VERSION }}-cuda${{ env.CUDA_VERSION }}
30 changes: 30 additions & 0 deletions docker/Dockerfile_ubuntu_headless
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Preamble
ARG AV_REPO=alicevision/alicevision
ARG AV_VERSION
ARG CUDA_VERSION=11.8.0
ARG UBUNTU_VERSION=22.04
FROM ${AV_REPO}:${AV_VERSION}-ubuntu${UBUNTU_VERSION}-cuda${CUDA_VERSION}
LABEL maintainer="Hossam Hammady <[email protected]>"

# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-pip \
python3-setuptools \
python3-wheel \
python3-pkg-resources \
python-is-python3 && \
pip install --upgrade pip

ENV MESHROOM_DEV=/home
WORKDIR ${MESHROOM_DEV}

# Install the required packages for headless mode
COPY requirements-headless.txt ${MESHROOM_DEV}/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install python files
COPY setup-headless.py ${MESHROOM_DEV}/setup.py
COPY ./meshroom ${MESHROOM_DEV}/meshroom
COPY ./bin ${MESHROOM_DEV}/bin
RUN pip install --no-cache-dir -e .
4 changes: 2 additions & 2 deletions meshroom/nodes/aliceVision/Texturing.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Texturing(desc.AVCommandLineNode):
name='outputMeshFileType',
label='Mesh File Type',
description='File Type',
value='obj',
value='gltf',
values=('obj', 'gltf', 'fbx', 'stl'),
exclusive=True,
uid=[0],
Expand Down Expand Up @@ -329,7 +329,7 @@ class Texturing(desc.AVCommandLineNode):
name='outputMesh',
label='Mesh',
description='Output Mesh file.',
value=desc.Node.internalFolder + 'texturedMesh.{outputMeshFileTypeValue}',
value=desc.Node.internalFolder + 'texturedMesh.*', # gltf generates an additional .bin file
uid=[],
group='',
),
Expand Down
2 changes: 2 additions & 0 deletions requirements-headless.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
psutil>=5.6.7
requests==2.22.0
18 changes: 18 additions & 0 deletions setup-headless.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from setuptools import setup


setup(
name='meshroom-headless',
version='0.1.0',
description='Meshroom headless',
install_requires=['psutil', 'requests'],
packages=['meshroom'],
scripts=[
'bin/meshroom_batch',
'bin/meshroom_compute',
'bin/meshroom_newNodeType',
'bin/meshroom_statistics',
'bin/meshroom_status',
'bin/meshroom_submit'
]
)