Skip to content

Commit

Permalink
initial set of changes
Browse files Browse the repository at this point in the history
# Conflicts:
#	ARCHITECTURE.md
#	CONTRIBUTING.md
#	inno_setup.iss
  • Loading branch information
iLLiCiTiT committed Jun 27, 2023
1 parent fd1e4ff commit 5d21076
Show file tree
Hide file tree
Showing 13 changed files with 298 additions and 5,489 deletions.
73 changes: 7 additions & 66 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,15 @@
# Architecture

OpenPype is a monolithic Python project that bundles several parts, this document will try to give a birds eye overview of the project and, to a certain degree, each of the sub-projects.
The current file structure looks like this:
AYON desktop is a Python project that handles cares about updates of addons, dependency packages and destkop updates from server. It also provides a way to launch the AYON desktop application.

```
.
├── common - Code in this folder is backend portion of Addon distribution logic for v4 server.
── docs - Documentation of the source code.
├── igniter - The OpenPype bootstrapper, deals with running version resolution and setting up the connection to the mongodb.
├── openpype - The actual OpenPype core package.
── schema - Collection of JSON files describing schematics of objects. This follows Avalon's convention.
├── common - Content is added to sys.path on bootstrap.
│ └── ayon_common
├── connection - Logic and UI related to connecion to server (changeof server/login).
├── distribution - Code in this folder is backend portion of distribution logic from server.
│ └── resources - Common resources usable anywhere in AYON processes.
├── tests - Integration and unit tests.
├── tools - Conveninece scripts to perform common actions (in both bash and ps1).
├── vendor - When using the igniter, it deploys third party tools in here, such as ffmpeg.
└── website - Source files for https://openpype.io/ which is Docusaursus (https://docusaurus.io/).
```

The core functionality of the pipeline can be found in `igniter` and `openpype`, which in turn rely on the `schema` files, whenever you build (or download a pre-built) version of OpenPype, these two are bundled in there, and `Igniter` is the entry point.


## Igniter

It's the setup and update tool for OpenPype, unless you want to package `openpype` separately and deal with all the config manually, this will most likely be your entry point.

```
igniter/
├── bootstrap_repos.py - Module that will find or install OpenPype versions in the system.
├── __init__.py - Igniter entry point.
├── install_dialog.py- Show dialog for choosing central pype repository.
├── install_thread.py - Threading helpers for the install process.
├── __main__.py - Like `__init__.py` ?
├── message_dialog.py - Qt Dialog with a message and "Ok" button.
├── nice_progress_bar.py - Fancy Qt progress bar.
├── splash.txt - ASCII art for the terminal installer.
├── stylesheet.css - Installer Qt styles.
├── terminal_splash.py - Terminal installer animation, relies in `splash.txt`.
├── tools.py - Collection of methods that don't fit in other modules.
├── update_thread.py - Threading helper to update existing OpenPype installs.
├── update_window.py - Qt UI to update OpenPype installs.
├── user_settings.py - Interface for the OpenPype user settings.
└── version.py - Igniter's version number.
```

## OpenPype

This is the main package of the OpenPype logic, it could be loosely described as a combination of [Avalon](https://getavalon.github.io), [Pyblish](https://pyblish.com/) and glue around those with custom OpenPype only elements, things are in progress of being moved around to better prepare for V4, which will be released under a new name AYON.

```
openpype/
├── client - Interface for the MongoDB.
├── hooks - Hooks to be executed on certain OpenPype Applications defined in `openpype.lib.applications`.
├── host - Base class for the different hosts.
├── hosts - Integration with the different DCCs (hosts) using the `host` base class.
├── lib - Libraries that stitch together the package, some have been moved into other parts.
├── modules - OpenPype modules should contain separated logic of specific kind of implementation, such as Ftrack connection and its python API.
├── pipeline - Core of the OpenPype pipeline, handles creation of data, publishing, etc.
├── plugins - Global/core plugins for loader and publisher tool.
├── resources - Icons, fonts, etc.
├── scripts - Loose scipts that get run by tools/publishers.
├── settings - OpenPype settings interface.
├── style - Qt styling.
├── tests - Unit tests.
├── tools - Core tools, check out https://openpype.io/docs/artist_tools.
├── vendor - Vendoring of needed required Python packes.
├── widgets - Common re-usable Qt Widgets.
├── action.py - LEGACY: Lives now in `openpype.pipeline.publish.action` Pyblish actions.
├── cli.py - Command line interface, leverages `click`.
├── __init__.py - Sets two constants.
├── __main__.py - Entry point, calls the `cli.py`
├── plugin.py - Pyblish plugins.
├── pype_commands.py - Implementation of OpenPype commands.
└── version.py - Current version number.
└── vendor - Dependencies required by AYON desktop that are not added to PYTHONPATH.
```
42 changes: 11 additions & 31 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
## How to contribute to Pype

We are always happy for any contributions for OpenPype improvements. Before making a PR and starting working on an issue, please read these simple guidelines.
## How to contribute to AYON
We are always happy for any contributions for AYON improvements. Before making a PR and starting working on an issue, please read these simple guidelines.

#### **Did you find a bug?**

1. Check in the issues and our [bug triage[(https://github.com/pypeclub/pype/projects/2) to make sure it wasn't reported already.
2. Ask on our [discord](http://pype.community/chat) Often, what appears as a bug, might be the intended behaviour for someone else.
1. Check in the [issues](https://github.com/ynput/OpenPype/issues) to make sure it wasn't reported already.
2. Ask on our [discord](https://discord.gg/ynput) Often, what appears as a bug, might be the intended behaviour for someone else.
3. Create a new issue.
4. Use the issue template for you PR please.

Expand All @@ -17,37 +16,18 @@ We are always happy for any contributions for OpenPype improvements. Before maki

#### **Do you intend to add a new feature or change an existing one?**

- Open a new thread in the [github discussions](https://github.com/pypeclub/pype/discussions/new)
- Open a new thread in the [github discussions](https://github.com/ynput/OpenPype/discussions/new)
- Do not open issue until the suggestion is discussed. We will convert accepted suggestions into backlog and point them to the relevant discussion thread to keep the context.
- If you are already working on a new feature and you'd like it eventually merged to the main codebase, please consider making a DRAFT PR as soon as possible. This makes it a lot easier to give feedback, discuss the code and functionalit, plus it prevents multiple people tackling the same problem independently.

#### **Do you have questions about the source code?**

Open a new question on [github discussions](https://github.com/pypeclub/pype/discussions/new)

## Branching Strategy

As we move to 3.x as the primary supported version of pype and only keep 2.15 on bug bugfixes and client sponsored feature requests, we need to be very careful with merging strategy.
Open a new question on [github discussions](https://github.com/ynput/OpenPype/discussions/new)

We also use this opportunity to switch the branch naming. 3.0 production branch will no longer be called MASTER, but will be renamed to MAIN. Develop will stay as it is.

A few important notes about 2.x and 3.x development:

- 3.x features are not backported to 2.x unless specifically requested
- 3.x bugs and hotfixes can be ported to 2.x if they are relevant or severe
- 2.x features and bugs MUST be ported to 3.x at the same time

## Pull Requests

- Each 2.x PR MUST have a corresponding 3.x PR in github. Without 3.x PR, 2.x features will not be merged! Luckily most of the code is compatible, albeit sometimes in a different place after refactor. Porting from 2.x to 3.x should be really easy.
- Please keep the corresponding 2 and 3 PR names the same so they can be easily identified from the PR list page.
- Each 2.x PR should be labeled with `2.x-dev` label.

Inside each PR, put a link to the corresponding PR for the other version

Of course if you want to contribute, feel free to make a PR to only 2.x/develop or develop, based on what you are using. While reviewing the PRs, we might convert the code to corresponding PR for the other release ourselves.

We might also change the target of you PR to and intermediate branch, rather than `develop` if we feel it requires some extra work on our end. That way, we preserve all your commits so you don't loose out on the contribution credits.


If a PR is targeted at 2.x release it must be labelled with 2x-dev label in Github.
- We have few requirements in branch naming. There must be one of prefixes in the branch name: `release/`, `enhancement/`, `feature/`, `bugfix/`, `documentation/`, `tests/`, `local/`, `chore/`. All characters lowered.
- Keep pull requests targeted to a single issue or feature. The review is usually much faster.
- If you are working on a new feature, please consider making a DRAFT PR as soon as possible. This makes it a lot easier to give feedback, discuss the code and functionality, plus it prevents multiple people tackling the same problem independently.
- PR resolving existing issue should have link to the issue in the description (`Resolves #123`) -> The issue will be automatically closed in that case.
- Follow PR template as much as possible. If the PR is fixing an issue add a link to issue or describe the issue in PR description.
28 changes: 14 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Build Pype docker image
FROM ubuntu:focal AS builder
ARG OPENPYPE_PYTHON_VERSION=3.9.12
ARG PYTHON_VERSION=3.9.12
ARG BUILD_DATE
ARG VERSION

LABEL maintainer="[email protected]"
LABEL description="Docker Image to build and run OpenPype under Ubuntu 20.04"
LABEL org.opencontainers.image.name="pypeclub/openpype"
LABEL org.opencontainers.image.title="OpenPype Docker Image"
LABEL org.opencontainers.image.url="https://openpype.io/"
LABEL org.opencontainers.image.source="https://github.com/pypeclub/OpenPype"
LABEL org.opencontainers.image.documentation="https://openpype.io/docs/system_introduction"
LABEL org.opencontainers.image.name="ynput/desktop"
LABEL org.opencontainers.image.title="AYON Desktop Docker Image"
LABEL org.opencontainers.image.url="https://ayon.ynput.io/"
LABEL org.opencontainers.image.source="https://github.com/ynput/OpenPype"
LABEL org.opencontainers.image.documentation="https://ayon.ynput.io"
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.version=$VERSION

Expand Down Expand Up @@ -48,7 +48,7 @@ RUN apt-get update \
SHELL ["/bin/bash", "-c"]


RUN mkdir /opt/openpype
RUN mkdir /opt/ayon

# download and install pyenv
RUN curl https://pyenv.run | bash \
Expand All @@ -59,24 +59,24 @@ RUN curl https://pyenv.run | bash \

# install python with pyenv
RUN source $HOME/init_pyenv.sh \
&& pyenv install ${OPENPYPE_PYTHON_VERSION}
&& pyenv install ${PYTHON_VERSION}

COPY . /opt/openpype/
COPY . /opt/ayon/

RUN chmod +x /opt/openpype/tools/create_env.sh && chmod +x /opt/openpype/tools/build.sh
RUN chmod +x /opt/ayon/tools/create_env.sh && chmod +x /opt/ayon/tools/build.sh

WORKDIR /opt/openpype
WORKDIR /opt/ayon

# set local python version
RUN cd /opt/openpype \
RUN cd /opt/ayon \
&& source $HOME/init_pyenv.sh \
&& pyenv local ${OPENPYPE_PYTHON_VERSION}
&& pyenv local ${PYTHON_VERSION}

# fetch third party tools/libraries
RUN source $HOME/init_pyenv.sh \
&& ./tools/create_env.sh \
&& ./tools/fetch_thirdparty_libs.sh

# build openpype
# build ayon desktop
RUN source $HOME/init_pyenv.sh \
&& bash ./tools/build.sh
39 changes: 20 additions & 19 deletions Dockerfile.centos7
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Build Pype docker image
FROM centos:7 AS builder
ARG OPENPYPE_PYTHON_VERSION=3.9.12

LABEL org.opencontainers.image.name="pypeclub/openpype"
LABEL org.opencontainers.image.title="OpenPype Docker Image"
LABEL org.opencontainers.image.url="https://openpype.io/"
LABEL org.opencontainers.image.source="https://github.com/pypeclub/pype"
LABEL org.opencontainers.image.documentation="https://openpype.io/docs/system_introduction"
ARG PYTHON_VERSION=3.9.12

LABEL description="Docker Image to build and run OpenPype under Ubuntu 20.04"
LABEL org.opencontainers.image.name="ynput/desktop"
LABEL org.opencontainers.image.title="AYON Desktop Docker Image"
LABEL org.opencontainers.image.url="https://ayon.ynput.io/"
LABEL org.opencontainers.image.source="https://github.com/ynput/OpenPype"
LABEL org.opencontainers.image.documentation="https://ayon.ynput.io"
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.version=$VERSION

Expand Down Expand Up @@ -59,9 +60,9 @@ RUN git clone -b 0.17.0 --single-branch https://github.com/NixOS/patchelf.git .
&& make \
&& make install

RUN mkdir /opt/openpype
RUN mkdir /opt/ayon
# RUN useradd -m pype
# RUN chown pype /opt/openpype
# RUN chown pype /opt/ayon
# USER pype

RUN curl https://pyenv.run | bash
Expand All @@ -71,21 +72,21 @@ RUN echo 'export PATH="$HOME/.pyenv/bin:$PATH"'>> $HOME/.bashrc \
&& echo 'eval "$(pyenv init -)"' >> $HOME/.bashrc \
&& echo 'eval "$(pyenv virtualenv-init -)"' >> $HOME/.bashrc \
&& echo 'eval "$(pyenv init --path)"' >> $HOME/.bashrc
RUN source $HOME/.bashrc && pyenv install ${OPENPYPE_PYTHON_VERSION}
RUN source $HOME/.bashrc && pyenv install ${PYTHON_VERSION}

COPY . /opt/openpype/
RUN rm -rf /openpype/.poetry || echo "No Poetry installed yet."
COPY . /opt/ayon/
RUN rm -rf /opt/ayon/.poetry || echo "No Poetry installed yet."
# USER root
# RUN chown -R pype /opt/openpype
RUN chmod +x /opt/openpype/tools/create_env.sh && chmod +x /opt/openpype/tools/build.sh
# RUN chown -R pype /opt/ayon
RUN chmod +x /opt/ayon/tools/create_env.sh && chmod +x /opt/ayon/tools/build.sh

# USER pype

WORKDIR /opt/openpype
WORKDIR /opt/ayon

RUN cd /opt/openpype \
RUN cd /opt/ayon \
&& source $HOME/.bashrc \
&& pyenv local ${OPENPYPE_PYTHON_VERSION}
&& pyenv local ${PYTHON_VERSION}

RUN source $HOME/.bashrc \
&& ./tools/create_env.sh
Expand All @@ -99,8 +100,8 @@ RUN source $HOME/.bashrc \
RUN cp /usr/lib64/libffi* ./build/exe.linux-x86_64-3.9/lib \
&& cp /usr/lib64/libssl* ./build/exe.linux-x86_64-3.9/lib \
&& cp /usr/lib64/libcrypto* ./build/exe.linux-x86_64-3.9/lib \
&& cp /root/.pyenv/versions/${OPENPYPE_PYTHON_VERSION}/lib/libpython* ./build/exe.linux-x86_64-3.9/lib \
&& cp /root/.pyenv/versions/${PYTHON_VERSION}/lib/libpython* ./build/exe.linux-x86_64-3.9/lib \
&& cp /usr/lib64/libxcb* ./build/exe.linux-x86_64-3.9/vendor/python/PySide2/Qt/lib

RUN cd /opt/openpype \
RUN cd /opt/ayon \
rm -rf ./vendor/bin
28 changes: 14 additions & 14 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Build Pype docker image
FROM debian:bullseye AS builder
ARG OPENPYPE_PYTHON_VERSION=3.9.12
ARG PYTHON_VERSION=3.9.12
ARG BUILD_DATE
ARG VERSION

LABEL maintainer="[email protected]"
LABEL description="Docker Image to build and run OpenPype under Ubuntu 20.04"
LABEL org.opencontainers.image.name="pypeclub/openpype"
LABEL org.opencontainers.image.title="OpenPype Docker Image"
LABEL org.opencontainers.image.url="https://openpype.io/"
LABEL org.opencontainers.image.source="https://github.com/pypeclub/OpenPype"
LABEL org.opencontainers.image.documentation="https://openpype.io/docs/system_introduction"
LABEL org.opencontainers.image.name="ynput/desktop"
LABEL org.opencontainers.image.title="AYON Desktop Docker Image"
LABEL org.opencontainers.image.url="https://ayon.ynput.io/"
LABEL org.opencontainers.image.source="https://github.com/ynput/OpenPype"
LABEL org.opencontainers.image.documentation="https://ayon.ynput.io"
LABEL org.opencontainers.image.created=$BUILD_DATE
LABEL org.opencontainers.image.version=$VERSION

Expand Down Expand Up @@ -47,7 +47,7 @@ RUN apt-get update \
SHELL ["/bin/bash", "-c"]


RUN mkdir /opt/openpype
RUN mkdir /opt/ayon

# download and install pyenv
RUN curl https://pyenv.run | bash \
Expand All @@ -58,24 +58,24 @@ RUN curl https://pyenv.run | bash \

# install python with pyenv
RUN source $HOME/init_pyenv.sh \
&& pyenv install ${OPENPYPE_PYTHON_VERSION}
&& pyenv install ${PYTHON_VERSION}

COPY . /opt/openpype/
COPY . /opt/ayon/

RUN chmod +x /opt/openpype/tools/create_env.sh && chmod +x /opt/openpype/tools/build.sh
RUN chmod +x /opt/ayon/tools/create_env.sh && chmod +x /opt/ayon/tools/build.sh

WORKDIR /opt/openpype
WORKDIR /opt/ayon

# set local python version
RUN cd /opt/openpype \
RUN cd /opt/ayon \
&& source $HOME/init_pyenv.sh \
&& pyenv local ${OPENPYPE_PYTHON_VERSION}
&& pyenv local ${PYTHON_VERSION}

# fetch third party tools/libraries
RUN source $HOME/init_pyenv.sh \
&& ./tools/create_env.sh \
&& ./tools/fetch_thirdparty_libs.sh

# build openpype
# build ayon desktop
RUN source $HOME/init_pyenv.sh \
&& bash ./tools/build.sh
Loading

0 comments on commit 5d21076

Please sign in to comment.