Skip to content

Commit

Permalink
Promote to AIO repo (v0.3.0-preview) (#35)
Browse files Browse the repository at this point in the history
Promote to AIO repo

---------

Co-authored-by: Azure IoT Operations Bot <[email protected]>
  • Loading branch information
chgennar and Azure IoT Operations Bot authored Jan 31, 2024
1 parent 913211f commit 6be62bc
Show file tree
Hide file tree
Showing 11 changed files with 292 additions and 311 deletions.
71 changes: 61 additions & 10 deletions .github/workflows/create-azure-iot-operations-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,35 @@ on:
description: 'Version to publish'
required: true
type: string

isDraft:
description: 'Whether the release should be a draft release.'
required: true
type: boolean
default: true
releaseBranchEnabled:
description: 'Whether the release branch creation is enabled.'
required: true
type: boolean
default: false
workflow_call:
inputs:
version:
description: 'Version to publish'
required: true
type: string
isDraft:
description: 'Whether the release should be a draft release.'
required: true
type: boolean
default: true
releaseBranchEnabled:
description: 'Whether the release branch creation is enabled.'
required: true
type: boolean
default: false

jobs:
Version:
ValidateRelease:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.templateVersion.outputs.version }}
Expand All @@ -32,18 +58,22 @@ jobs:
run: |-
set -e
# strip spaces from version
version=$(echo "${{ github.event.inputs.version }}" | tr -d '[:space:]')
version=$(echo "${{ inputs.version }}" | tr -d '[:space:]')
if [[ -z "$version" ]]; then
echo "::error::Valid version is required"
fi
if [[ $version != v* ]]; then
echo "::error::Version must begin with 'v'"
fi
echo "Set version to $version"
echo "version=${version}" >> $GITHUB_OUTPUT
PreRelease:
CreateRelease:
runs-on: ubuntu-latest
needs: Version
needs: ValidateRelease
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down Expand Up @@ -81,24 +111,45 @@ jobs:
set -e
gh auth login --with-token <<< "${{ github.token }}"
url=$(gh release create "${{ needs.Version.outputs.version }}" \
--draft \
url=$(gh release create "${{ needs.ValidateRelease.outputs.version }}" \
--latest \
--prerelease \
--target "${{ github.ref }}" \
--repo "${{ github.repository }}" \
--title "${{ needs.Version.outputs.version }}" \
--title "${{ needs.ValidateRelease.outputs.version }}" \
$( ${{ inputs.isDraft }} && echo "--draft" ) \
$(echo "${{ steps.buildAssets.outputs.filelist }}" | tr "," " "))
echo "url=$url" >> $GITHUB_OUTPUT
- name: Summarize
run: |-
IFS=',' read -r -a files <<< "${{ steps.buildAssets.outputs.filelist }}"
echo "# PreRelease ${{ needs.Version.outputs.version }} created" >> $GITHUB_STEP_SUMMARY
echo "# Release ${{ needs.ValidateRelease.outputs.version }} created" >> $GITHUB_STEP_SUMMARY
echo "A draft release has been created with the following assets:" >> $GITHUB_STEP_SUMMARY
for file in "${files[@]}"; do
echo "- $file" >> $GITHUB_STEP_SUMMARY
done
echo "" >> $GITHUB_STEP_SUMMARY
echo "The release can be found [here](${{ steps.createRelease.outputs.url }})" >> $GITHUB_STEP_SUMMARY
CreateReleaseBranch:
runs-on: ubuntu-latest
needs: CreateRelease
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Create Release Branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
set -e
git config --global user.email "[email protected]"
git config --global user.name "Azure IoT Operations Bot"
if [ ${{inputs.releaseBranchEnabled}} == true ]; then
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
git branch release/${{inputs.version}}
git push origin release/${{inputs.version}}
fi
51 changes: 14 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ This repo contains the deployment definition of Azure IoT Operations (AIO) and a
AIO to be deployed to an Arc-enabled K8s cluster. This repository does not encourage pull requests, as the repo is
meant for publicly sharing the releases of AIO and not shared development of AIO.

Please see the [Azure IoT Operations Documentation](https://aka.ms/AIOdocs).
Please see the [Azure IoT Operations documentation](https://aka.ms/AIOdocs) for more information. To learn how to
deploy AIO using GitOps, see the [Deploy to cluster documentation](https://learn.microsoft.com/en-us/azure/iot-operations/deploy-iot-ops/howto-deploy-iot-operations?tabs=github#deploy-extensions).

## Forking the Repo

Expand All @@ -28,46 +29,22 @@ need to take to set up the fork.
in your fork. Repository secrets can be found under **Settings** > **Secrets and
variables** > **Actions**. To learn more, see [creating secrets for a repository](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository).

2. To be able to use secrets in AIO, follow [Manage Secrets](https://learn.microsoft.com/en-us/azure/iot-operations/deploy-iot-ops/howto-manage-secrets) to create an AKV and a Service Principal with access to AKV.
2. Enable GitHub actions on the fork.

3. Create and setup K8s Arc-enabled cluster.
1. On the forked repo, select **Actions** and select **I understand my workflows, go ahead and enable them.**

1. If you don't have an existing K8s cluster, try [minikube](https://minikube.sigs.k8s.io/docs/).
## Available Parameters

2. Arc-enable your K8s cluster using the [az connectedk8s connect](https://learn.microsoft.com/cli/azure/connectedk8s#az-connectedk8s-connect) command.
Various parameters can be specified when deploying AIO. The below table describes these parameters. For an example parameter file, see `environments/example.parameters.json`.

```bash
az connectedk8s connect -n $CLUSTER_NAME -l $LOCATION -g $RESOURCE_GROUP --subscription $SUBSCRIPTION_ID
```
3. Use the [az connectedk8s enable-features](https://learn.microsoft.com/cli/azure/connectedk8s?view=azure-cli-latest#az-connectedk8s-enable-features) command to enable custom location support on your cluster.
```bash
az connectedk8s enable-features -n $CLUSTER_NAME -g $RESOURCE_GROUP --features cluster-connect custom-locations
```
3. Run cluster setup script from `tools/setup-cluster/setup-cluster.sh`.
1. In setup-cluster.sh, update the variables at the top of the script to have the values for your Azure Subscription, Resources, and Cluster.
4. Deploy Azure IoT Operations.
1. Create parameter file where environment configuration is specified for your AIO deployment. For an example, see `environments/example.parameters.json`.
| **Parameter** | **Requirement** | **Type** | **Description** |
| ------------- |--|------------|-------------- |
| clusterName | ***[Required]*** | `string` | The Arc-enabled cluster resource in Azure. |
| clusterLocation | *[Optional]* | `string` |If the cluster resource's location is different than its resource group's location, the cluster location will need to be specified. Otherwise, this parameter will default to the location of the resource group. |
| location | *[Optional]* | `string` | If the resource group's location is not a supported AIO region, this parameter can be used to override the location of the AIO resources. |
| dataProcessorSecrets | *[Optional]*<sup>1</sup>| `object` | Add the name of the SecretProviderClass and k8s AKV SP secret that were created from the `setup-cluster.sh`. This should be something like `aio-default-spc` and `aio-akv-sp`, respectively. <br><br>Example:<br> <pre>{<br> "secretProviderClassName": "aio-default-spc",<br> "servicePrincipalSecretRef": "aio-akv-sp"<br>}</pre>|
| mqSecrets | *[Optional]*<sup>1</sup>| `object` | Add the name of the SecretProviderClass and k8s AKV SP secret that were created from the `setup-cluster.sh`. This should be something like `aio-default-spc` and `aio-akv-sp`, respectively. <br><br>Example:<br> <pre>{<br> "secretProviderClassName": "aio-default-spc",<br> "servicePrincipalSecretRef": "aio-akv-sp"<br>}</pre>|
| opcUaBrokerSecrets | *[Optional]*<sup>1</sup>| `object` | Add the name of the k8s AKV SP secret that was created from the `setup-cluster.sh`. This should be something like `aio-akv-sp` and kind should be `csi`. <br><br>Example:<br> <pre>{<br> "kind": "csi",<br> "csiServicePrincipalSecretRef": "aio-akv-sp"<br>}</pre>|

> <sup>1</sup> This param is only necessary if you are using different values than the defaults specified in `setup-cluster.sh`.

2. On the forked repo, select **Actions** and select **I understand my workflows, go ahead and enable them.**

3. Run the **Deploy Azure IoT Operations** GitHub Action. You'll need to provide both the `subscription` and `resource group` where your Arc-enabled cluster resource is and the path to the `environment parameters file` you created previously.
| **Parameter** | **Requirement** | **Type** | **Description** |
| ------------- |--|------------|-------------- |
| clusterName | ***[Required]*** | `string` | The Arc-enabled cluster resource in Azure. |
| clusterLocation | *[Optional]* | `string` |If the cluster resource's location is different than its resource group's location, the cluster location will need to be specified. Otherwise, this parameter will default to the location of the resource group. |
| location | *[Optional]* | `string` | If the resource group's location is not a supported AIO region, this parameter can be used to override the location of the AIO resources. |
| simulatePLC | *[Optional]* | `boolean` | Flag to enable a simulated PLC. The default is false. |
| opcuaDiscoveryEndpoint | *[Optional]* | `string` | The OPC UA Discovery Endpoint used by Akri. The default is opc.tcp://<NOT_SET>:<NOT_SET>. |
| deployResourceSyncRules | *[Optional]* | `boolean` | Flag to deploy the default resource sync rules for the AIO arc extensions. The default is `true`.|
## Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is
Expand Down
Loading

0 comments on commit 6be62bc

Please sign in to comment.