forked from rh-aiservices-bu/parasol-insurance
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rh-aiservices-bu#102 from rh-aiservices-bu/feature…
…/enrich-database enrich db - first pass
- Loading branch information
Showing
10 changed files
with
183 additions
and
125 deletions.
There are no files selected for viewing
Binary file added
BIN
+77.3 KB
bootstrap/ic-shared-database/images/original_images/1_1700087084_5f809e2a_car1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+64.5 KB
bootstrap/ic-shared-database/images/original_images/2_1700187120_b49918e5_car2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59 KB
bootstrap/ic-shared-database/images/original_images/3_1700187127_14fecc0f_car3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+494 KB
...p/ic-shared-database/images/processed_images/1_1700086614_cdfe1fac_new_car1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+326 KB
...p/ic-shared-database/images/processed_images/1_1700187172_eb6ba78d_new_car2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+421 KB
...p/ic-shared-database/images/processed_images/3_1700187181_1cafe160_new_car3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: populate-images | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "2" | ||
spec: | ||
backoffLimit: 4 | ||
template: | ||
spec: | ||
initContainers: | ||
- name: wait-for-minio | ||
image: busybox:1.28 | ||
command: ['sh', '-c', 'until nc -z -v -w30 $MINIO_ENDPOINT 9000; do echo "Waiting for Minio connection..."; sleep 2; done;'] | ||
env: | ||
- name: MINIO_ENDPOINT | ||
value: minio.ic-shared-minio.svc.cluster.local | ||
containers: | ||
- name: add-images-to-bucket | ||
image: image-registry.openshift-image-registry.svc:5000/redhat-ods-applications/s2i-generic-data-science-notebook:1.2 | ||
imagePullPolicy: IfNotPresent | ||
command: ["/bin/bash"] | ||
args: | ||
- -ec | ||
- |- | ||
git clone https://github.com/rh-aiservices-bu/insurance-claim-processing.git | ||
cat << 'EOF' | python3 | ||
import boto3, os | ||
s3 = boto3.client("s3", | ||
endpoint_url=os.getenv("AWS_S3_ENDPOINT"), | ||
aws_access_key_id=os.getenv("AWS_ACCESS_KEY_ID"), | ||
aws_secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY")) | ||
# Create image bucket | ||
bucket_name = "claim-images" | ||
s3.create_bucket(Bucket=bucket_name) | ||
# Upload original images to minio | ||
for filename in os.listdir("insurance-claim-processing/bootstrap/ic-shared-database/images/original_images"): | ||
with open(f"insurance-claim-processing/bootstrap/ic-shared-database/images/original_images/{filename}", "rb") as f: | ||
s3.upload_fileobj(f, bucket_name, f"original_images/{filename}") | ||
# Upload processed images to minio | ||
for filename in os.listdir("insurance-claim-processing/bootstrap/ic-shared-database/images/processed_images"): | ||
with open(f"insurance-claim-processing/bootstrap/ic-shared-database/images/processed_images/{filename}", "rb") as f: | ||
s3.upload_fileobj(f, bucket_name, f"processed_images/{filename}") | ||
EOF | ||
envFrom: | ||
- secretRef: | ||
name: secret-minio | ||
restartPolicy: Never |
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,14 @@ | ||
kind: Secret | ||
apiVersion: v1 | ||
metadata: | ||
name: secret-minio | ||
namespace: ic-shared-db | ||
labels: | ||
app: ic-shared-db | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "1" | ||
stringData: | ||
AWS_S3_ENDPOINT: http://minio.ic-shared-minio.svc.cluster.local:9000 | ||
AWS_ACCESS_KEY_ID: minio | ||
AWS_SECRET_ACCESS_KEY: minio123 | ||
type: Opaque |
237 changes: 112 additions & 125 deletions
237
bootstrap/ic-shared-database/sql-script-configmap.yaml
Large diffs are not rendered by default.
Oops, something went wrong.