25 Commits

Author SHA1 Message Date
Iain Sproat c39aec0850 chore(speckle-automate-github-action): bump to 0.8.0 (#16)
- fixes to README
2023-11-12 17:32:25 +00:00
Iain Sproat 2eacc79a5b chore(deps): bump speckle-automate-github-action from 0.7.0 to 0.7.1 (#15) 2023-11-10 23:06:22 +00:00
dependabot[bot] d9b35b8221 build(deps): Bump actions/checkout from 3 to 4 (#8)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 17:50:48 +00:00
dependabot[bot] 16a7c69d01 build(deps): Bump docker/login-action from 2.2.0 to 3.0.0 (#10)
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v2.2.0...v3.0.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 17:48:55 +00:00
dependabot[bot] efd9578585 build(deps): Bump docker/build-push-action from 4.1.1 to 5.0.0 (#11)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.1.1 to 5.0.0.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.1.1...v5.0.0)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-07 17:48:35 +00:00
Iain Sproat ccf80151b1 chore(README): Update README to include compute resources (#14) 2023-11-07 17:42:24 +00:00
Iain Sproat 87109a5b60 chore(deps): bump speckle-automate-github-action from 0.6.1 to 0.7.0 (#13)
* chore(deps): bump speckle-automate-github-action from 0.6.1 to 0.7.0

* Define the inputs
2023-11-06 18:12:00 +01:00
Iain Sproat 11d6caebcb Validate inputs are set (#12) 2023-10-16 11:08:42 +01:00
Gergő Jedlicska 4d68562f25 fix checking logic 2023-09-22 13:44:34 +02:00
Gergő Jedlicska 88894c4098 check if image already exists 2023-09-22 13:43:07 +02:00
Gergő Jedlicska e598aac514 fix string quote 2023-09-22 12:31:32 +02:00
Gergő Jedlicska 94ef717fde parsing automate host 2023-09-22 12:27:31 +02:00
Gergő Jedlicska d75eed9a05 fix release tag variable using env 2023-09-22 11:59:53 +02:00
Gergő Jedlicska 7339de2094 fix release tag variable again 2023-09-22 11:53:46 +02:00
Gergő Jedlicska a444b30ba0 fix release tag variable 2023-09-22 11:51:32 +02:00
Gergő Jedlicska 1d7dfb167a rearrange steps to stop publishing broken releases 2023-09-22 11:38:07 +02:00
Gergő Jedlicska 008772a47e Update to new speckle automate action
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-09-18 17:51:09 +02:00
Gergő Jedlicska 5d41ad720f Update action.yml
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-11 16:22:50 +02:00
Gergő Jedlicska a7568a91bd fix missing action id definition
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-11 16:19:11 +02:00
Gergő Jedlicska ef6a3b899f Update action.yml
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-11 16:06:43 +02:00
Gergő Jedlicska 3ea9375091 Update action.yml
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-10 17:23:02 +02:00
Gergő Jedlicska 9992edd0e7 propagate function input path value
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-10 17:13:24 +02:00
Gergő Jedlicska 8f046e505b update schema handling to a file path based aproach
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-10 17:10:22 +02:00
Gergő Jedlicska 02a2e9a0fa update to new functions action
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-10 16:29:47 +02:00
Gergő Jedlicska e18f046ce0 update functions github action version
Signed-off-by: Gergő Jedlicska <57442769+gjedlicska@users.noreply.github.com>
2023-08-10 16:09:54 +02:00
3 changed files with 89 additions and 23 deletions
+1 -1
View File
@@ -9,6 +9,6 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0
+9 -7
View File
@@ -32,13 +32,7 @@ Please note that this is not a Speckle Account token, but a **Speckle Automate A
Your Speckle Token must have write permissions for the Speckle Function with this ID, otherwise the publish will fail.
#### `speckle_function_path`
The path to the Speckle Automate Function to publish. This path is relative to the root of the repository. If you provide a path to a directory, your Speckle Automate Function must be in a file named `specklefunction.yaml` within that directory.
Defaults to the root of the repository.
#### `speckle_function_input_schema`
#### `speckle_function_input_schema_file_path`
The path to a file containing a JSON Schema. This JSON Schema defines the parameters required by the Function. The JSON Schema will be used to automatically create the User Interface displayed to users of your Function in Speckle Automate. Users will be able to provide their data to customise the Function.
@@ -50,6 +44,14 @@ Defaults to `./input-schema.json`
For example, if you are using Python, you might use `python3 main.py`. If you are using Node.js, you might use `node main.js`. If using bash shell, `bash main.sh` etc. etc.. Even if the command is defined within your Dockerfile (for examples, using the `CMD` or `ENTRYPOINT` statements), you must provide the command here in order for Speckle Automate to run the function.
#### `speckle_function_recommended_cpu_m`
The recommended maximum CPU in millicores for the function. 1000 millicores = 1 CPU core. Defaults to 1000 millicores (1 CPU core). If the Function exceeds this limit, it will be throttled to run within the limit.
#### `speckle_function_recommended_memory_mi`
The recommended maximum memory in mebibytes for the function. 1024 mebibytes = 1 gibibyte. Defaults to 100 mebibytes. If the Function exceeds this limit, it will be terminated.
#### `dockerfile_path`
Path to the Dockerfile to be used to build the Speckle Function.
+79 -15
View File
@@ -15,13 +15,18 @@ inputs:
speckle_function_id:
description: 'The unique identifier of the function. Go to Speckle Automate to register your Function and get its Identifier.'
required: true
speckle_function_input_schema:
description: 'JSON Schema defining the parameters required by the Function. These will be used to create the User Interface displayed to users of your Function in Speckle Automate. Users will be able to provide their data to customise the Function.'
speckle_function_input_schema_file_path:
description: 'File path containing JSON Schema of the parameters object required by the function. These will be used to create the User Interface displayed to users of your Function in Speckle Automate. Users will be able to provide their data to customise the Function.'
required: false
default: './input-schema.json'
speckle_function_command:
description: 'The command to run to execute the function in a runtime environment.'
required: true
speckle_function_recommended_cpu_m:
description: 'The recommended maximum CPU in millicores for the function. 1000 millicores = 1 CPU core. Defaults to 1000 millicores (1 CPU core). If the Function exceeds this limit, it will be throttled to run within the limit.'
required: false
speckle_function_recommended_memory_mi:
description: 'The recommended maximum memory in mebibytes for the function. 1024 mebibytes = 1 gibibyte. Defaults to 100 mebibytes. If the Function exceeds this limit, it will be terminated.'
required: false
dockerfile_path:
description: 'Path to the Dockerfile to be used to build the Speckle Function.'
required: false
@@ -33,26 +38,85 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3.5.3 # checkout the repository in which this GitHub Action is being used.
- name: Speckle Automate function version publisher
uses: specklesystems/speckle-automate-github-action@0.2.1
with:
speckle_automate_url: ${{ inputs.speckle_automate_url }}
speckle_token: ${{ inputs.speckle_token }}
speckle_function_id: ${{ inputs.speckle_function_id }}
speckle_function_input_schema: ${{ inputs.speckle_function_input_schema }}
speckle_function_command: ${{ inputs.speckle_function_command }}
- uses: actions/checkout@v4 # checkout the repository in which this GitHub Action is being used.
- name: Validate inputs
shell: bash
run: |
if [ -z "${{ inputs.speckle_token }}" ]; then
echo "ERROR: speckle_token secret is required"
exit 1
fi
if [ -z "${{ inputs.speckle_automate_url }}" ]; then
echo "ERROR: speckle_automate_url input value is required"
exit 1
fi
if [ -z "${{ inputs.speckle_function_id }}" ]; then
echo "ERROR: speckle_function_id input value is required"
exit 1
fi
if [ -z "${{ inputs.speckle_function_input_schema_file_path }}" ]; then
echo "ERROR: speckle_function_input_schema_file_path input value is required"
exit 1
fi
if [ -z "${{ inputs.speckle_function_command }}" ]; then
echo "ERROR: speckle_function_command input value is required"
exit 1
fi
- name: Set Version tag
shell: bash
run: |
echo "Determining Release tag value"
if [[ ${GITHUB_REF_TYPE} == "tag" ]]
then
echo "Workflow triggered by a git tag"
RELEASE_TAG=${GITHUB_REF_NAME}
else
echo "Workflow triggered on a git branch"
RELEASE_TAG=$(git rev-parse --short ${GITHUB_SHA})
fi
echo "Setting the function's releaseTag to: ${RELEASE_TAG}"
echo "releaseTag=${RELEASE_TAG}" >> "$GITHUB_ENV"
- name: Log in to Speckle Automate Docker registry
uses: docker/login-action@v2.2.0
uses: docker/login-action@v3.0.0
with:
registry: ${{ inputs.speckle_automate_url }}
username: ${{ inputs.speckle_token }}
password: ${{ inputs.speckle_token }}
- name: Parse automate host
shell: bash
run: |
AUTOMATE_HOST=$(python -c 'from urllib.parse import urlparse; print(urlparse("${{ inputs.speckle_automate_url }}").netloc)')
echo "Parsed automate host: ${AUTOMATE_HOST}"
echo "automateHost=${AUTOMATE_HOST}" >>"$GITHUB_ENV"
- name: Ensure image doesn't exist in registry
shell: bash
run: |
set +e
docker manifest inspect ${{ env.automateHost }}/${{ inputs.speckle_function_id }}:${{ env.releaseTag }}
if [[ $? == 0 ]]
then
echo "Cannot override the existing release tag ${{ env.releaseTag }}. Please publish a new release!"
exit 1
fi
- name: Build and push Docker image
uses: docker/build-push-action@v4.1.1
uses: docker/build-push-action@v5.0.0
with:
context: ${{ inputs.docker_context }}
file: ${{ inputs.dockerfile_path }}
tags: ${{ steps.register-speckle-function-version.outputs.speckle_automate_host }}/${{ inputs.speckle_function_id }}:${{ steps.register-speckle-function-version.outputs.version_id }}
tags: ${{ env.automateHost }}/${{ inputs.speckle_function_id }}:${{ env.releaseTag }}
target: ''
push: true
- name: Speckle Automate function version publisher
uses: specklesystems/speckle-automate-github-action@0.8.0
id: register_speckle_function_version
with:
speckle_automate_url: ${{ inputs.speckle_automate_url }}
speckle_token: ${{ inputs.speckle_token }}
speckle_function_id: ${{ inputs.speckle_function_id }}
speckle_function_input_schema_file_path: ${{ inputs.speckle_function_input_schema_file_path }}
speckle_function_release_tag: ${{ env.releaseTag }}
speckle_function_command: ${{ inputs.speckle_function_command }}
speckle_function_recommended_cpu_m: ${{ inputs.speckle_function_recommended_cpu_m }}
speckle_function_recommended_memory_mi: ${{ inputs.speckle_function_recommended_memory_mi }}