Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ccf80151b1 | |||
| 87109a5b60 | |||
| 11d6caebcb | |||
| 4d68562f25 |
@@ -50,6 +50,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.
|
||||
|
||||
+33
-2
@@ -21,6 +21,12 @@ inputs:
|
||||
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,6 +39,29 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/checkout@v3.5.3 # 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: |
|
||||
@@ -66,7 +95,7 @@ runs:
|
||||
run: |
|
||||
set +e
|
||||
docker manifest inspect ${{ env.automateHost }}/${{ inputs.speckle_function_id }}:${{ env.releaseTag }}
|
||||
if [[ $? == 1 ]]
|
||||
if [[ $? == 0 ]]
|
||||
then
|
||||
echo "Cannot override the existing release tag ${{ env.releaseTag }}. Please publish a new release!"
|
||||
exit 1
|
||||
@@ -80,7 +109,7 @@ runs:
|
||||
target: ''
|
||||
push: true
|
||||
- name: Speckle Automate function version publisher
|
||||
uses: specklesystems/speckle-automate-github-action@0.6.1
|
||||
uses: specklesystems/speckle-automate-github-action@0.7.0
|
||||
id: register_speckle_function_version
|
||||
with:
|
||||
speckle_automate_url: ${{ inputs.speckle_automate_url }}
|
||||
@@ -89,3 +118,5 @@ runs:
|
||||
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 }}
|
||||
|
||||
Reference in New Issue
Block a user