Skip to content

Commit

Permalink
Merge pull request #55 from Teradata/defult-ports
Browse files Browse the repository at this point in the history
updating hardcoded ports to defaults and jupyter version
  • Loading branch information
teralauritsen authored Nov 12, 2024
2 parents ce4c3d8 + 90eff2d commit 82e359a
Show file tree
Hide file tree
Showing 6 changed files with 186 additions and 60 deletions.
70 changes: 49 additions & 21 deletions deployments/aws/templates/ai-unlimited/ai-unlimited-with-nlb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Metadata:
- AiUnlimitedSchedulerVersion
- AiUnlimitedSchedulerHttpPort
- AiUnlimitedSchedulerGrpcPort
- AiUnlimitedUiPort
- AiUnlimitedUiHttpsPort
- AiUnlimitedUiVersion
- Label:
default: Persistent volume
Expand Down Expand Up @@ -134,6 +136,22 @@ Parameters:
MinValue: 0
MaxValue: 65535

AiUnlimitedUiPort:
Description: port to access the AI Unlimited UI.
Type: Number
Default: 80
ConstraintDescription: must be a valid ununsed port between 0 and 65535.
MinValue: 0
MaxValue: 65535

AiUnlimitedUiHttpsPort:
Description: port to allow https access the AI Unlimited UI.
Type: Number
Default: 443
ConstraintDescription: must be a valid ununsed port between 0 and 65535.
MinValue: 0
MaxValue: 65535

AiUnlimitedVersion:
Description: Which version of AI Unlimited to deploy, uses container version tags, defaults to "latest"
Type: String
Expand Down Expand Up @@ -370,6 +388,11 @@ Conditions:
- !Ref IamRoleName
- ""

PortIsNotEighty: !Not
- !Equals
- !Ref AiUnlimitedUiPort
- 80

Resources:
AiUnlimitedVolume:
DeletionPolicy: !Ref PersistentVolumeDeletionPolicy
Expand Down Expand Up @@ -507,12 +530,14 @@ Resources:
ExecStartPre=-/usr/bin/docker rm %n || true
ExecStartPre=/usr/bin/docker pull teradata/ai-unlimited-workspaces-ui:${ AiUnlimitedUiVersion }
ExecStart=/usr/bin/docker run \
-e accept_license=Y \
-e PLATFORM=aws \
-e TD_VCD_USE_TLS=false \
-e TD_VCD_API_PORT=${ AiUnlimitedGrpcPort } \
-e TD_VCD_AUTH_PORT=${ AiUnlimitedAuthPort } \
-e TD_VCD_INIT_API_KEY \
-p 80:80 \
-p 443:443 \
-p ${ AiUnlimitedUiPort }:80 \
-p ${ AiUnlimitedUiHttpsPort }:443 \
-v ssl_certs:/etc/ssl/td \
--network ai_unlimited \
--rm --name %n teradata/ai-unlimited-workspaces-ui:${ AiUnlimitedUiVersion }
Expand Down Expand Up @@ -693,9 +718,9 @@ Resources:
- HASSECURITYGROUP
- !Ref SecurityGroup
- !Ref AWS::NoValue
- FromPort: 80
- FromPort: !Ref AiUnlimitedUiPort
IpProtocol: tcp
ToPort: 80
ToPort: !Ref AiUnlimitedUiPort
CidrIp: !If
- HASCIDR
- !Ref AccessCIDR
Expand All @@ -708,9 +733,9 @@ Resources:
- HASSECURITYGROUP
- !Ref SecurityGroup
- !Ref AWS::NoValue
- FromPort: 443
- FromPort: !Ref AiUnlimitedUiHttpsPort
IpProtocol: tcp
ToPort: 443
ToPort: !Ref AiUnlimitedUiHttpsPort
CidrIp: !If
- HASCIDR
- !Ref AccessCIDR
Expand Down Expand Up @@ -797,7 +822,7 @@ Resources:
- Type: forward
TargetGroupArn: !Ref AiUnlimitedUITargetGroup
LoadBalancerArn: !Ref LoadBalancer
Port: 80
Port: !Ref AiUnlimitedUiPort
Protocol: TCP

AiUnlimitedUISSLListener:
Expand All @@ -807,7 +832,7 @@ Resources:
- Type: forward
TargetGroupArn: !Ref AiUnlimitedUIHTTPSTargetGroup
LoadBalancerArn: !Ref LoadBalancer
Port: 443
Port: !Ref AiUnlimitedUiHttpsPort
Protocol: TCP

AiUnlimitedSchedulerHTTPListener:
Expand Down Expand Up @@ -885,7 +910,7 @@ Resources:
- ui
- http
- api
Port: 80
Port: !Ref AiUnlimitedUiPort
Protocol: TCP
TargetGroupAttributes:
- Key: stickiness.enabled
Expand All @@ -896,7 +921,7 @@ Resources:
Value: "20"
Targets:
- Id: !Ref AiUnlimitedServer
Port: 80
Port: !Ref AiUnlimitedUiPort
VpcId: !Ref Vpc

AiUnlimitedUIHTTPSTargetGroup:
Expand All @@ -920,7 +945,7 @@ Resources:
- ui
- https
- api
Port: 443
Port: !Ref AiUnlimitedUiHttpsPort
Protocol: TCP
TargetGroupAttributes:
- Key: stickiness.enabled
Expand All @@ -931,7 +956,7 @@ Resources:
Value: "20"
Targets:
- Id: !Ref AiUnlimitedServer
Port: 443
Port: !Ref AiUnlimitedUiHttpsPort
VpcId: !Ref Vpc

AiUnlimitedGRPCTargetGroup:
Expand Down Expand Up @@ -1055,12 +1080,12 @@ Resources:
ToPort: !Ref AiUnlimitedGrpcPort
SourceSecurityGroupId: !GetAtt LoadBalancerAiUnlimitedSecurityGroup.GroupId
- IpProtocol: tcp
FromPort: 80
ToPort: 80
FromPort: !Ref AiUnlimitedUiPort
ToPort: !Ref AiUnlimitedUiPort
SourceSecurityGroupId: !GetAtt LoadBalancerAiUnlimitedSecurityGroup.GroupId
- IpProtocol: tcp
FromPort: 443
ToPort: 443
FromPort: !Ref AiUnlimitedUiHttpsPort
ToPort: !Ref AiUnlimitedUiHttpsPort
SourceSecurityGroupId: !GetAtt LoadBalancerAiUnlimitedSecurityGroup.GroupId
- !If
- HASSECURITYGROUP
Expand All @@ -1079,15 +1104,15 @@ Resources:
- !If
- HASSECURITYGROUP
- IpProtocol: tcp
FromPort: 80
ToPort: 80
FromPort: !Ref AiUnlimitedUiPort
ToPort: !Ref AiUnlimitedUiPort
SourceSecurityGroupId: !Ref SecurityGroup
- !Ref AWS::NoValue
- !If
- HASSECURITYGROUP
- IpProtocol: tcp
FromPort: 443
ToPort: 443
FromPort: !Ref AiUnlimitedUiHttpsPort
ToPort: !Ref AiUnlimitedUiHttpsPort
SourceSecurityGroupId: !Ref SecurityGroup
- !Ref AWS::NoValue

Expand Down Expand Up @@ -1362,7 +1387,10 @@ Outputs:

AiUnlimitedUiAccess:
Description: Loadbalancer access endpoint for AI Unlimited UI Access
Value: !Sub http://${ LoadBalancer.DNSName }
Value: !If
- PortIsNotEighty
- !Sub http://${ LoadBalancer.DNSName }:${ AiUnlimitedUiPort }/healthcheck
- !Sub http://${ LoadBalancer.DNSName }

AiUnlimitedApiAccess:
Description: Loadbalancer access endpoint for AI Unlimited API Access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Metadata:
- AiUnlimitedSchedulerVersion
- AiUnlimitedSchedulerHttpPort
- AiUnlimitedSchedulerGrpcPort
- AiUnlimitedUiPort
- AiUnlimitedUiHttpsPort
- AiUnlimitedUiVersion
- Label:
default: Persistent volume
Expand Down Expand Up @@ -119,6 +121,22 @@ Parameters:
MinValue: 0
MaxValue: 65535

AiUnlimitedUiPort:
Description: port to access the AI Unlimited UI.
Type: Number
Default: 80
ConstraintDescription: must be a valid ununsed port between 0 and 65535.
MinValue: 0
MaxValue: 65535

AiUnlimitedUiHttpsPort:
Description: port to allow https access the AI Unlimited UI.
Type: Number
Default: 443
ConstraintDescription: must be a valid ununsed port between 0 and 65535.
MinValue: 0
MaxValue: 65535

AiUnlimitedVersion:
Description: Which version of AI Unlimited to deploy, uses container version tags, defaults to "latest"
Type: String
Expand Down Expand Up @@ -355,6 +373,21 @@ Conditions:
- !Ref IamRoleName
- ""

PortIsNotEightyAndHasPublicIp: !And
- !Not
- !Equals
- !Ref Private
- "true"
- !Not
- !Equals
- !Ref AiUnlimitedUiPort
- 80

PortIsNotEighty: !Not
- !Equals
- !Ref AiUnlimitedUiPort
- 80

Resources:
AiUnlimitedVolume:
DeletionPolicy: !Ref PersistentVolumeDeletionPolicy
Expand Down Expand Up @@ -498,8 +531,8 @@ Resources:
-e TD_VCD_API_PORT=${ AiUnlimitedGrpcPort } \
-e TD_VCD_AUTH_PORT=${ AiUnlimitedAuthPort } \
-e TD_VCD_INIT_API_KEY \
-p 80:80 \
-p 443:443 \
-p ${ AiUnlimitedUiPort }:80 \
-p ${ AiUnlimitedUiHttpsPort }:443 \
-v ssl_certs:/etc/ssl/td \
--network ai_unlimited \
--rm --name %n teradata/ai-unlimited-workspaces-ui:${ AiUnlimitedUiVersion }
Expand Down Expand Up @@ -685,9 +718,9 @@ Resources:
- HASSECURITYGROUP
- !Ref SecurityGroup
- !Ref AWS::NoValue
- FromPort: 80
- FromPort: !Ref AiUnlimitedUiPort
IpProtocol: tcp
ToPort: 80
ToPort: !Ref AiUnlimitedUiPort
CidrIp: !If
- HASCIDR
- !Ref AccessCIDR
Expand All @@ -700,9 +733,9 @@ Resources:
- HASSECURITYGROUP
- !Ref SecurityGroup
- !Ref AWS::NoValue
- FromPort: 443
- FromPort: !Ref AiUnlimitedUiHttpsPort
IpProtocol: tcp
ToPort: 443
ToPort: !Ref AiUnlimitedUiHttpsPort
CidrIp: !If
- HASCIDR
- !Ref AccessCIDR
Expand Down Expand Up @@ -992,12 +1025,18 @@ Outputs:

AiUnlimitedPublicUIAccess:
Description: Teradata AI Unlimited public UI Access
Value: !Sub http://${AiUnlimitedServer.PublicDnsName}
Value: !If
- PortIsNotEightyAndHasPublicIp
- !Sub http://${AiUnlimitedServer.PublicDnsName}:${AiUnlimitedUiPort}/healthcheck
- !Sub http://${AiUnlimitedServer.PublicDnsName}
Condition: HASPUBLICIP

AiUnlimitedPrivateUIAccess:
Description: Teradata AI Unlimited private UI Access
Value: !Sub http://${AiUnlimitedServer.PrivateDnsName}
Value: !If
- PortIsNotEighty
- !Sub http://${AiUnlimitedServer.PrivateDnsName}:${AiUnlimitedUiPort}/healthcheck
- !Sub http://${AiUnlimitedServer.PrivateDnsName}

AiUnlimitedPublicAPIAccess:
Description: Teradata AI Unlimited public API Access
Expand Down
Loading

0 comments on commit 82e359a

Please sign in to comment.