|
| 1 | +# Union.ai on EKS Pattern |
| 2 | + |
| 3 | +Union.ai empowers AI development teams to rapidly ship high-quality code to production by offering optimized performance, resource efficiency, and workflow authoring experience. With Union.ai your team can: |
| 4 | + |
| 5 | +- Run complex AI workloads with performance, scale, and efficiency. |
| 6 | +- Scale out to multiple regions, clusters, and clouds as needed for resource availability, scale, or compliance. |
| 7 | + |
| 8 | +Union.ai’s modular architecture allows for great flexibility and control. The customer can decide how many clusters to have, their shape, and who has access to what. All communication is encrypted. |
| 9 | + |
| 10 | +<p align="center"> |
| 11 | + <a href="https://www.union.ai"> |
| 12 | + <img alt="Union Self-managed Architecture" src="https://www.union.ai/docs/v1/selfmanaged/_static/images/deployment/architecture.svg" width="600" /> |
| 13 | + </a> |
| 14 | +</p> |
| 15 | + |
| 16 | + |
| 17 | +## Prerequisites |
| 18 | + |
| 19 | +Ensure that you have installed the following tools on your machine: |
| 20 | + |
| 21 | +- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) (also ensure it is [configured](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html#getting-started-quickstart-new)) |
| 22 | +- [cdk](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install) |
| 23 | +- [npm](https://docs.npmjs.com/cli/v8/commands/npm-install) |
| 24 | +- [tsc](https://www.typescriptlang.org/download) |
| 25 | +- [make](https://www.gnu.org/software/make/) |
| 26 | +- uctl |
| 27 | + |
| 28 | +### Installing `uctl` |
| 29 | + |
| 30 | +On Mac: |
| 31 | +```bash |
| 32 | +brew tap unionai/homebrew-tap |
| 33 | +brew install uctl |
| 34 | +``` |
| 35 | + |
| 36 | +With cURL: |
| 37 | +```bash |
| 38 | +curl -sL https://raw.githubusercontent.com/unionai/uctl/main/install.sh | bash |
| 39 | +``` |
| 40 | + |
| 41 | +## Deployment |
| 42 | + |
| 43 | +### Setup Union Credentials |
| 44 | + |
| 45 | +Both the control plane URL and cluster name will be provided by Union. Union will also provide authentication information for your account to access the hosted control plane. |
| 46 | + |
| 47 | +```bash |
| 48 | +export UNION_CONTROL_PLANE_URL=<YOUR_UNION_CONTROL_PLANE_URL> |
| 49 | +export UNION_CLUSTER_NAME=<YOUR_SELECTED_CLUSTER_NAME> |
| 50 | +export UNION_ORG_NAME=<YOUR_SELECTED_ORG_NAME> |
| 51 | + |
| 52 | +uctl config init --host=$UNION_CONTROL_PLANE_URL |
| 53 | +uctl selfserve provision-dataplane-resources --clusterName $UNION_CLUSTER_NAME --provider aws |
| 54 | +``` |
| 55 | + |
| 56 | +This command will output the ID, name, and secret used by Union services to communicate with the control plane. |
| 57 | + |
| 58 | +### Create Union Secrets in AWS Secrets Manager |
| 59 | + |
| 60 | +```bash |
| 61 | +export UNION_SECRET_NAME=union-secret |
| 62 | +aws secretsmanager create-secret --name $UNION_SECRET_NAME \ |
| 63 | + --secret-string "{\"host\":\"$UNION_CONTROL_PLANE_URL\",\"clusterName\":\"$UNION_CLUSTER_NAME\",\"orgName\":\"$UNION_ORG_NAME\"}" |
| 64 | + |
| 65 | +export UNION_CLIENT_SECRET_NAME=union-client-secret |
| 66 | +export UNION_CLIENT_ID_SECRET_VALUE=<CLUSTERAUTHCLIENTID_FROM_SELFSERVE_COMMAND> |
| 67 | +export UNION_SECRET_SECRET_VALUE=<CLUSTERAUTHCLIENTSECRET_FROM_SELFSERVE_COMMAND> |
| 68 | + |
| 69 | +aws secretsmanager create-secret --name $UNION_CLIENT_SECRET_NAME \ |
| 70 | + --secret-string "{\"clientId\":\"$UNION_CLIENT_ID_SECRET_VALUE\",\"clientSecret\":\"$UNION_SECRET_SECRET_VALUE\"}" |
| 71 | +``` |
| 72 | + |
| 73 | +### Clone the repository: |
| 74 | + |
| 75 | +```sh |
| 76 | +git clone https://github.com/aws-samples/cdk-eks-blueprints-patterns.git |
| 77 | +cd cdk-eks-blueprints-patterns |
| 78 | +``` |
| 79 | + |
| 80 | +### Run the following commands: |
| 81 | + |
| 82 | +```sh |
| 83 | +make deps |
| 84 | +make build |
| 85 | +make pattern unionai deploy |
| 86 | +``` |
| 87 | + |
| 88 | +### Validation |
| 89 | + |
| 90 | +Run the command: |
| 91 | +```bash |
| 92 | +kubectl get deploy -A |
| 93 | +``` |
| 94 | + |
| 95 | +Output should be: |
| 96 | +```bash |
| 97 | +NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE |
| 98 | +kube-system blueprints-addon-metrics-server 1/1 1 1 57d |
| 99 | +kube-system blueprints-addon-union-dataplane-kube-state-metrics 1/1 1 1 57d |
| 100 | +unionai executor 1/1 1 1 57d |
| 101 | +unionai flytepropeller 1/1 1 1 57d |
| 102 | +unionai flytepropeller-webhook 1/1 1 1 57d |
| 103 | +unionai opencost 1/1 1 1 57d |
| 104 | +unionai prometheus-operator 1/1 1 1 57d |
| 105 | +unionai syncresources 1/1 1 1 57d |
| 106 | +unionai union-operator 1/1 1 1 57d |
| 107 | +unionai union-operator-proxy 1/1 1 1 57d |
| 108 | +``` |
| 109 | + |
| 110 | +To validate the cluster has been successfully registered to the Union control plane run the command: |
| 111 | +```bash |
| 112 | +uctl get cluster |
| 113 | +``` |
| 114 | + |
| 115 | +Output should be: |
| 116 | +```bash |
| 117 | + ----------- ------- --------------- ----------- |
| 118 | +| NAME | ORG | STATE | HEALTH | |
| 119 | + ----------- ------- --------------- ----------- |
| 120 | +| <cluster> | <org> | STATE_ENABLED | HEALTHY | |
| 121 | + ----------- ------- --------------- ----------- |
| 122 | +1 rows |
| 123 | +``` |
| 124 | + |
| 125 | +### 8. Register and run example workflows |
| 126 | + |
| 127 | +```bash |
| 128 | +uctl register examples --project=union-health-monitoring --domain=development |
| 129 | +uctl validate snacks --project=union-health-monitoring --domain=development |
| 130 | + ---------------------- ----------------------------------- ---------- -------------------------------- -------------- ----------- --------------- |
| 131 | +| NAME | LAUNCH PLAN NAME | VERSION | STARTED AT | ELAPSED TIME | RESULT | ERROR MESSAGE | |
| 132 | + ---------------------- ----------------------------------- ---------- -------------------------------- -------------- ----------- --------------- |
| 133 | +| alskkhcd6wx5m6cqjlwm | basics.hello_world.hello_world_wf | v0.3.341 | 2025-05-09T18:30:02.968183352Z | 4.452440953s | SUCCEEDED | | |
| 134 | + ---------------------- ----------------------------------- ---------- -------------------------------- -------------- ----------- --------------- |
| 135 | +1 rows |
| 136 | +``` |
0 commit comments