-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from natmhnty/ai-chatbot
Works in Ec2 shell
- Loading branch information
Showing
15 changed files
with
194 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 5 additions & 14 deletions
19
manifests/modules/aiml/chatbot/.workshop/terraform/outputs.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,10 @@ | ||
output "environment_variables" { | ||
description = "Environment variables to be added to the IDE shell" | ||
value = { | ||
AIML_NEURON_ROLE_ARN = module.iam_assumable_role_chatbot.iam_role_arn | ||
AIML_NEURON_BUCKET_NAME = resource.aws_s3_bucket.chatbot.id | ||
AIML_DL_IMAGE = "763104351884.dkr.ecr.${data.aws_region.current.name}.amazonaws.com/pytorch-chatbot-neuron:1.13.1-neuron-py310-sdk2.12.0-ubuntu20.04" | ||
AIML_SUBNETS = "${data.aws_subnets.private.ids[0]},${data.aws_subnets.private.ids[1]},${data.aws_subnets.private.ids[2]}" | ||
KARPENTER_NODE_ROLE = module.eks_blueprints_addons.karpenter.node_iam_role_name | ||
KARPENTER_ARN = module.eks_blueprints_addons.karpenter.node_iam_role_arn | ||
AIML_SUBNETS = "${data.aws_subnets.private.ids[0]},${data.aws_subnets.private.ids[1]},${data.aws_subnets.private.ids[2]}" | ||
KARPENTER_NODE_ROLE = module.eks_blueprints_addons.karpenter.node_iam_role_name | ||
KARPENTER_ARN = module.eks_blueprints_addons.karpenter.node_iam_role_arn | ||
LBC_CHART_VERSION = var.load_balancer_controller_chart_version | ||
LBC_ROLE_ARN = module.eks_blueprints_addons.aws_load_balancer_controller.iam_role_arn | ||
} | ||
} | ||
|
||
#output "subnet_details" { | ||
#value = merge({ | ||
#GRAVITON_NODE_ROLE = aws_iam_role.graviton_node.arn | ||
#}, { | ||
#for index, id in data.aws_subnets.private.ids : "PRIMARY_SUBNET_${index + 1}" => id | ||
#}) | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
manifests/modules/aiml/chatbot/k8s-neuron-device-plugin-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# rbac.yaml | ||
--- | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: neuron-device-plugin | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- events | ||
verbs: | ||
- create | ||
- patch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
verbs: | ||
- update | ||
- patch | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- nodes/status | ||
verbs: | ||
- patch | ||
- update | ||
--- | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: neuron-device-plugin | ||
namespace: kube-system | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: neuron-device-plugin | ||
namespace: kube-system | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: neuron-device-plugin | ||
subjects: | ||
- kind: ServiceAccount | ||
name: neuron-device-plugin | ||
namespace: kube-system |
95 changes: 95 additions & 0 deletions
95
manifests/modules/aiml/chatbot/k8s-neuron-device-plugin.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: neuron-device-plugin-daemonset | ||
namespace: kube-system | ||
spec: | ||
selector: | ||
matchLabels: | ||
name: neuron-device-plugin-ds | ||
updateStrategy: | ||
type: RollingUpdate | ||
template: | ||
metadata: | ||
# Uncomment the annotation below if k8s version is 1.13 or lower | ||
# annotations: | ||
# scheduler.alpha.kubernetes.io/critical-pod: "" | ||
labels: | ||
name: neuron-device-plugin-ds | ||
spec: | ||
serviceAccount: neuron-device-plugin | ||
tolerations: | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- key: aws.amazon.com/neuron | ||
operator: Exists | ||
effect: NoSchedule | ||
# Mark this pod as a critical add-on; when enabled, the critical add-on | ||
# scheduler reserves resources for critical add-on pods so that they can | ||
# be rescheduled after a failure. | ||
# See https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/ | ||
priorityClassName: "system-node-critical" | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
# Uncomment following matchExpressions if using k8s 1.16 or lower | ||
#- matchExpressions: | ||
# - key: "beta.kubernetes.io/instance-type" | ||
# operator: In | ||
# values: | ||
# - inf1.xlarge | ||
# - inf1.2xlarge | ||
# - inf1.6xlarge | ||
# - inf1.24xlarge | ||
# - inf2.xlarge | ||
# - inf2.8xlarge | ||
# - inf2.24xlarge | ||
# - inf2.48xlarge | ||
# - trn1.2xlarge | ||
# - trn1.32xlarge | ||
# - trn1n.32xlarge | ||
- matchExpressions: | ||
- key: "node.kubernetes.io/instance-type" | ||
operator: In | ||
values: | ||
- inf1.xlarge | ||
- inf1.2xlarge | ||
- inf1.6xlarge | ||
- inf1.24xlarge | ||
- inf2.xlarge | ||
- inf2.8xlarge | ||
- inf2.24xlarge | ||
- inf2.48xlarge | ||
- trn1.2xlarge | ||
- trn1.32xlarge | ||
- trn1n.32xlarge | ||
containers: | ||
# Find all neuron-device-plugin images at https://gallery.ecr.aws/neuron/neuron-device-plugin | ||
- image: public.ecr.aws/neuron/neuron-device-plugin:2.19.16.0 | ||
imagePullPolicy: Always | ||
name: neuron-device-plugin | ||
env: | ||
- name: KUBECONFIG | ||
value: /etc/kubernetes/kubelet.conf | ||
- name: NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: ["ALL"] | ||
volumeMounts: | ||
- name: device-plugin | ||
mountPath: /var/lib/kubelet/device-plugins | ||
- name: infa-map | ||
mountPath: /run | ||
volumes: | ||
- name: device-plugin | ||
hostPath: | ||
path: /var/lib/kubelet/device-plugins | ||
- name: infa-map | ||
hostPath: | ||
path: /run |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.