Skip to content

feat: Add standalone installer #244

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

Merged
merged 2 commits into from
Mar 28, 2025
Merged
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
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ See [DEVELOPMENT.md](https://github.com/aws-deadline/deadline-cloud-for-houdini/

#### Please run the integration tests and paste the results below.

#### #### If `installer/` was modified or a file was added/removed from `src/`, then update the installer tests and post the test results below.

### Was this change documented?

*delete text starting here*
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/build_installers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "Build Installers"

on:
workflow_dispatch:
inputs:
os:
required: true
default: Linux
type: choice
options:
- Linux
- Windows
- MacOS
ref_type:
required: true
default: tags
type: choice
options:
- tags
- heads
ref:
required: true
type: string
default: mainline
environment:
required: true
type: choice
options:
- mainline

jobs:
BuildInstaller:
if: (github.repository == 'aws-deadline/deadline-cloud-for-houdini')
name: Build Installer
uses: aws-deadline/.github/.github/workflows/reusable_build_installers.yml@mainline
secrets: inherit
with:
environment: ${{inputs.environment}}
ref_type: ${{inputs.ref_type}}
ref: ${{inputs.ref}}
oses: "['${{inputs.os}}']"
project_name: "deadline-cloud-for-houdini"
38 changes: 29 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,37 @@
# Build artifacts
/dist
/dependency_bundle/
/scripts/dependency_bundle/
/dev_install/
/wheels/

# License file for InstallBuilder
license.xml

*.egg-info/
__pycache__/
.coverage
.DS_Store
.tox
.venv
/htmlcov
.vscode
*_version.py
houdini_version.txt
/dependency_bundle/
/scripts/dependency_bundle/
/dev_install/
/wheels/
**/otls/backup
plugin_env

# Hatch version temp file
*_version.py
houdini_version.txt

# Extensions for installers, etc.
*.run
*.exe
*.zip
*.app
*.dmg

# virtualenv
.venv

# IDE
.vscode

# macOS
.DS_Store
22 changes: 22 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ You can work on the adaptor alongside your submitter development workflow using

3. Open the Houdini integrated submitter, and in the Job-Specific Settings tab, enable the option 'Include Adaptor Wheels'. Add the "wheels" folder. Then submit your test job.

## Build the Installer

If necessary, you can build a standalone installer for the Houdini submitter from the source XML in this repository.

1. Build the package with `hatch run build`.

2. Build the installer with `hatch`. Omit `--platform` to use the platform of your machine.
```bash
hatch run installer:build-installer --local-dev --platform <PLATFORM> [--install-builder-location <LOCATION> --output-dir <DIR>]

# To see the full list of arguments:
# hatch run installer:build-installer -h
```

## Testing

### Unit Tests
Expand Down Expand Up @@ -133,4 +147,12 @@ To run integration tests:
We provide a Python script that can set up and run integration tests for multiple Houdini versions consecutively. It takes a JSON string of versions and their executable locations as an argument:
```sh
$ python scripts/run_integ_tests.py "{\"19.5.805\": \"C:\\Program Files\\Side Effects Software\\Houdini 19.5.805\\bin\\hython.exe\", \"20.0.896\": \"C:\\Program Files\\Side Effects Software\\Houdini 20.0.896\\bin\\hython.exe\"}"
```

### Installer Tests
Installer tests are located in the `test/installer` directory. These tests assume that a built installer corresponding to your platform exists in the repository root.

To run the tests:
```bash
hatch run test-installer
```
5 changes: 5 additions & 0 deletions depsBundle.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

# This script is called in a shell subprocess.
# If editing this script, please see the security considerations
# of this invocation method:
# https://docs.python.org/3/library/subprocess.html#security-considerations
set -xeuo pipefail

SCRIPT_FOLDER=$(dirname "$0")/scripts
Expand Down
4 changes: 4 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pre-install-commands = [
[envs.default.scripts]
sync = "pip install -r requirements-testing.txt"
test = "pytest {args:test/unit}"
test-installer = "pytest --no-cov {args:test/installer} -vvv"
typing = "mypy {args:src test}"
style = [
"ruff check {args:.}",
Expand Down Expand Up @@ -34,6 +35,9 @@ build = "hatch build"
[envs.codebuild.env-vars]
SKIP_BOOTSTRAP_TEST_RESOURCES="True"

[envs.installer.scripts]
build-installer = "python {root}/scripts/build_installer_cli.py --installer-source-path {root}/installer/DeadlineCloudForHoudiniSubmitter.xml {args:}"

[envs.integ]
pre-install-commands = [
"pip install -r requirements-integ-testing.txt",
Expand Down
130 changes: 120 additions & 10 deletions install_builder/deadline-cloud-for-houdini.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -->
<componentGroup>
<name>deadline_cloud_for_houdini</name>
<description>Deadline Cloud for Houdini 19.5-20.5</description>
<description>Deadline Cloud for Houdini</description>
<detailedDescription>Houdini plugin for submitting jobs to AWS Deadline Cloud. Compatible with Houdini 19.5-20.5</detailedDescription>
<canBeEdited>1</canBeEdited>
<selected>0</selected>
Expand All @@ -14,7 +14,7 @@
<platforms>all</platforms>
<distributionFileList>
<distributionDirectory allowWildcards="1">
<origin>components/deadline-cloud-for-houdini/src/deadline/houdini_submitter/*</origin>
<origin>../src/deadline/houdini_submitter/*</origin>
</distributionDirectory>
</distributionFileList>
</folder>
Expand All @@ -25,7 +25,7 @@
<platforms>all</platforms>
<distributionFileList>
<distributionDirectory allowWildcards="1">
<origin>components/deadline-cloud-for-houdini/packages/*</origin>
<origin>../packages/*</origin>
</distributionDirectory>
</distributionFileList>
<actionList>
Expand All @@ -35,7 +35,7 @@
<type>exact</type>
<encoding>utf-8</encoding>
<substitutionList>
<substitution pattern="INSTALL_DIR_PLACEHOLDER" value="${installdir.unix}" />
<substitution pattern="INSTALL_DIR_PLACEHOLDER" value="${houdini_installdir}" />
</substitutionList>
</substitute>
<fnAddPathEnvironmentVariable>
Expand All @@ -44,6 +44,9 @@
<value>${houdini_packagedir}</value>
<scope>${installscope}</scope>
<insertAt>end</insertAt>
<ruleList>
<platformTest type="windows"/>
</ruleList>
</fnAddPathEnvironmentVariable>
</actionList>
</folder>
Expand All @@ -54,17 +57,109 @@
<platforms>all</platforms>
<distributionFileList>
<distributionDirectory allowWildcards="1">
<origin>components/deadline-cloud-for-houdini/dependency_bundle</origin>
<origin>../dependency_bundle</origin>
</distributionDirectory>
</distributionFileList>
</folder>
</folderList>
<functionDefinitionList>
<actionDefinition name="fnCopyHoudiniPackageFile">
<parameterList>
<stringParameter name="destinationDir"/>
</parameterList>
<actionList>
<createDirectory>
<path>${destinationDir}</path>
<ruleList>
<fileExists path="${destinationDir}" negate="1"/>
</ruleList>
</createDirectory>
<copyFile origin="${houdini_packagedir}/${deadline_package_file_name}" destination="${destinationDir}/${deadline_package_file_name}"/>
<addFilesToUninstaller files="${destinationDir}/${deadline_package_file_name}"/>
</actionList>
</actionDefinition>
</functionDefinitionList>
<componentList>
<component>
<name>houdini_19_5</name>
<description>Houdini 19.5</description>
<selected>0</selected>
<parameterList>
<directoryParameter>
<name>houdini_19_5_packagedir</name>
<description>Houdini 19.5 Packages Directory</description>
<explanation>Enter the path to the Houdini 19.5 packages directory. For easiest installation, Houdini should be installed before installing Deadline Cloud for Houdini.</explanation>
<default>${houdini_user_pref_dir_default}19.5/packages</default>
<allowEmptyValue>0</allowEmptyValue>
<ask>yes</ask>
<cliOptionName>houdini-19-5-package-dir</cliOptionName>
<cliOptionText>Path to the Houdini 19.5 packages directory. When the installer is run, if the HOUDINI_USER_PREF_DIR environment variable is set, this directory will default to the packages subdirectory at that path.</cliOptionText>
<mustBeWritable>yes</mustBeWritable>
</directoryParameter>
</parameterList>
<postInstallationActionList>
<fnCopyHoudiniPackageFile destinationDir="${houdini_19_5_packagedir}" />
</postInstallationActionList>
</component>
<component>
<name>houdini_20_0</name>
<description>Houdini 20.0</description>
<selected>0</selected>
<parameterList>
<directoryParameter>
<name>houdini_20_0_packagedir</name>
<description>Houdini 20.0 Packages Directory</description>
<explanation>Enter the path to the Houdini 20.0 packages directory. For easiest installation, Houdini should be installed before installing Deadline Cloud for Houdini.</explanation>
<default>${houdini_user_pref_dir_default}20.0/packages</default>
<allowEmptyValue>0</allowEmptyValue>
<ask>yes</ask>
<cliOptionName>houdini-20-0-package-dir</cliOptionName>
<cliOptionText>Path to the Houdini 20.0 packages directory. When the installer is run, if the HOUDINI_USER_PREF_DIR environment variable is set, this directory will default to the packages subdirectory at that path.</cliOptionText>
<mustBeWritable>yes</mustBeWritable>
</directoryParameter>
</parameterList>
<postInstallationActionList>
<fnCopyHoudiniPackageFile destinationDir="${houdini_20_0_packagedir}" />
</postInstallationActionList>
</component>
<component>
<name>houdini_20_5</name>
<description>Houdini 20.5</description>
<selected>0</selected>
<parameterList>
<directoryParameter>
<name>houdini_20_5_packagedir</name>
<description>Houdini 20.5 Packages Directory</description>
<explanation>Enter the path to the Houdini 20.5 packages directory. For easiest installation, Houdini should be installed before installing Deadline Cloud for Houdini.</explanation>
<default>${houdini_user_pref_dir_default}20.5/packages</default>
<allowEmptyValue>0</allowEmptyValue>
<ask>yes</ask>
<cliOptionName>houdini-20-5-package-dir</cliOptionName>
<cliOptionText>Path to the Houdini 20.5 packages directory. When the installer is run, if the HOUDINI_USER_PREF_DIR environment variable is set, this directory will default to the packages subdirectory at that path.</cliOptionText>
<mustBeWritable>yes</mustBeWritable>
</directoryParameter>
</parameterList>
<postInstallationActionList>
<fnCopyHoudiniPackageFile destinationDir="${houdini_20_5_packagedir}" />
</postInstallationActionList>
</component>
</componentList>
<initializationActionList>
<setInstallerVariable name="all_components" value="${all_components} deadline_cloud_for_houdini" />
</initializationActionList>
<readyToInstallActionList>
<setInstallerVariable name="houdini_installdir" value="${installdir}/Submitters/Houdini" />
<setInstallerVariable name="houdini_packagedir" value="${houdini_installdir}/deadline_package" />
<if>
<conditionRuleList>
<compareText>
<text>${env(HOUDINI_USER_PREF_DIR)}</text>
<logic>does_not_equal</logic>
<value></value>
</compareText>
</conditionRuleList>
<actionList>
<setInstallerVariable name="houdini_19_5_packagedir" value="${env(HOUDINI_USER_PREF_DIR)}/packages"/>
<setInstallerVariable name="houdini_20_0_packagedir" value="${env(HOUDINI_USER_PREF_DIR)}/packages"/>
<setInstallerVariable name="houdini_20_5_packagedir" value="${env(HOUDINI_USER_PREF_DIR)}/packages"/>
</actionList>
</if>
<if>
<conditionRuleList>
<platformTest type="windows" />
Expand Down Expand Up @@ -96,13 +191,28 @@
<deleteFile path="${houdini_user_pref_dir_default}19.5/packages/deadline_submitter_for_houdini.json" />
<deleteFile path="${houdini_user_pref_dir_default}20.0/packages/deadline_submitter_for_houdini.json" />
<deleteFile path="${houdini_user_pref_dir_default}20.5/packages/deadline_submitter_for_houdini.json" />
</initializationActionList>
<readyToInstallActionList>
<if>
<conditionRuleList>
<isTrue value="${individual_install}"/>
</conditionRuleList>
<actionList>
<setInstallerVariable name="houdini_installdir" value="${installdir}"/>
</actionList>
<elseActionList>
<setInstallerVariable name="houdini_installdir" value="${installdir}/Submitters/Houdini"/>
</elseActionList>
</if>
<setInstallerVariable name="houdini_packagedir" value="${houdini_installdir}/deadline_package" />
</readyToInstallActionList>
<parameterList>
<stringParameter name="deadline_cloud_for_houdini_summary" ask="0" cliOptionShow="0">
<value>Deadline Cloud for Houdini 19.5-20.5
- Compatible with Houdini 19.5-20.5
- Install the integrated Houdini submitter files to the installation directory.
- Register the plug-in package file with Houdini by setting HOUDINI_PACKAGE_DIR</value>
- Copy the plug-in package file to the Houdini packages directory for each version.
- Register the plug-in package file with Houdini by setting HOUDINI_PACKAGE_DIR on Windows.</value>
</stringParameter>
</parameterList>
<postInstallationActionList>
Expand Down
Loading