Skip to content

Commit

Permalink
[patch] remove minio role, add aws and minio config templates
Browse files Browse the repository at this point in the history
  • Loading branch information
karol-czarnecki committed May 15, 2024
1 parent 9ce53c8 commit 1507030
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 39 deletions.
5 changes: 4 additions & 1 deletion ibm/mas_devops/playbooks/oneclick_add_aibroker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
- lookup('env', 'IBM_ENTITLEMENT_USERNAME') != ""
- lookup('env', 'IBM_ENTITLEMENT_KEY') != ""
- lookup('env', 'MAS_INSTANCE_ID') != ""
- lookup('env', 'STORAGE_PROVIDER') != ""
fail_msg: "One or more required environment variables are not defined"

# TODO: check if three components exists in system
# TODO: vars for storage credentials

roles:
- ibm.mas_devops.odh
- ibm.mas_devops.minio
- ibm.mas_devops.kmodels
# - ibm.mas_devops.suite_app_install
# - ibm.mas_devops.suite_app_config
8 changes: 1 addition & 7 deletions ibm/mas_devops/roles/odh/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@
kubernetes.core.k8s:
template: "templates/aibroker/namespace.yml.j2"

# Create Storage class
# -----------------------------------------------------------------------------
# - name: "Create Storage class"
# kubernetes.core.k8s:
# template: "templates/aibroker/storage-class.yml.j2"

# Create DSCInitialization instance
# -----------------------------------------------------------------------------
- name: "Create DSCInitialization instance"
Expand Down Expand Up @@ -67,7 +61,7 @@
- name: "Create Create Data Science Pipelines Applications CR"
kubernetes.core.k8s:
apply: yes
definition: "{{ lookup('template', 'templates/odh/dspa-local-dev.yml.j2') }}"
definition: "{{ lookup('template', 'templates/odh/dspa-{{ storage_provider }}.yml.j2') }}"
register: dspa_lookup
# TODO: remove before finall commit
# - name: "debug Data Science Pipelines Applications"
Expand Down
17 changes: 0 additions & 17 deletions ibm/mas_devops/roles/odh/tasks/odh-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,3 @@
crd_name: knativeservings.operator.knative.dev
# TODO: add wait for operator success

- name: "Wait for all operators to be Succeeded"
kubernetes.core.k8s_info:
api_version: operators.coreos.com/v1alpha1
namespace: openshift-operators
kind: ClusterServiceVersion
register: odh_lookup
until:
- odh_lookup.resources is defined and odh_lookup.resources | length == 1
# - odh_lookup.resources[0].status is defined
# - odh_lookup.resources[0].status.phase is defined
- odh_lookup.resources[0].status.phase == 'Succeeded'
retries: 20
delay: 30

- name: "debug operators"
debug:
msg: "{{ odh_lookup.resources[0].status.phase }}"
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ metadata:
openshift.io/display-name: AWS S3 Connection
stringData:
# The following keys are needed while https://github.com/kubeflow/pipelines/issues/9689 is open
accesskey: "{{ s3_instance_accesskey }}"
secretkey: "{{ s3_instance_secretkey }}"
accesskey: "{{ storage_accesskey }}"
secretkey: "{{ storage_secretkey }}"
# Added for kmodels deployment script
host: s3.us-east-2.amazonaws.com
region: us-east-2
host: "{{ storage_host }}"
region: "{{ storage_region }}"
ssl: 'true'
---
apiVersion: datasciencepipelinesapplications.opendatahub.io/v1alpha1
Expand All @@ -31,8 +31,8 @@ spec:
objectStorage:
disableHealthCheck: true
externalStorage:
host: s3.us-east-2.amazonaws.com
region: us-east-2
host: "{{ storage_host }}"
region: "{{ storage_region }}"
bucket: km-pipeline-test
s3CredentialsSecret:
accessKey: accesskey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ metadata:
openshift.io/display-name: Minio Data Connection
stringData:
# The following keys are needed while https://github.com/kubeflow/pipelines/issues/9689 is open
accesskey: "{{ minio_instance_accesskey }}"
secretkey: "{{ minio_instance_secretkey }}"
accesskey: "{{ storage_accesskey }}"
secretkey: "{{ storage_secretkey }}"
# Added for kmodels deployment script
host: minio-service.minio.svc.cluster.local
host: "{{ storage_host }}"
port: "9000"
---
apiVersion: datasciencepipelinesapplications.opendatahub.io/v1alpha1
Expand All @@ -28,7 +28,7 @@ spec:
disableHealthCheck: true
objectStorage:
externalStorage:
host: minio-service.minio.svc.cluster.local
host: "{{ storage_host }}"
port: "9000"
bucket: mlpipeline
# region: us-east-2
Expand Down
11 changes: 7 additions & 4 deletions ibm/mas_devops/roles/odh/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ authorino_catalog_source: "{{ lookup('env', 'AUTHORINO_CATALOG_SOURCE') | defaul
# ODH operator vars
odh_channel: "{{ lookup('env', 'ODH_CHANNEL') | default('fast', true) }}"
odh_catalog_source: "{{ lookup('env', 'AUTHORINO_CATALOG_SOURCE') | default('community-operators', true) }}"
s3_instance_accesskey: "{{ lookup('env', 'S3_INSTANCE_ACCESSKEY') | default('', true) }}"
s3_instance_secretkey: "{{ lookup('env', 'S3_INSTANCE_SECRETKEY') | default('', true) }}"
minio_instance_accesskey: "{{ lookup('env', 'MINIO_INSTANCE_ACCESSKEY') | default('', true) }}"
minio_instance_secretkey: "{{ lookup('env', 'MINIO_INSTANCE_SECRETKEY') | default('', true) }}"

# Storage vars
storage_accesskey: "{{ lookup('env', 'STORAGE_ACCESSKEY') | default('', true) }}"
storage_secretkey: "{{ lookup('env', 'STORAGE_SECRETKEY') | default('', true) }}"
storage_host: "{{ lookup('env', 'STORAGE_HOST') | default('', true) }}"
storage_region: "{{ lookup('env', 'STORAGE_REGION') | default('', true) }}"
storage_provider: "{{ lookup('env', 'STORAGE_PROVIDER') | default('aws', true) }}"

0 comments on commit 1507030

Please sign in to comment.