oc apply -f deploy/crds/opendatahub_v1alpha1_opendatahub_crd.yaml
oc apply -f deploy/service_account.yaml
oc apply -f deploy/role.yaml
oc apply -f deploy/role_binding.yaml
oc apply -f deploy/operator.yaml
# customize odh manifest
oc apply -f my_environment_cr.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
#!/bin/bash | |
export NOTEBOOK_SCRIPT=$(basename patched-${S2I_SOURCE_NOTEBOOK} .ipynb).ipy | |
export S2I_SPARK_EXECUTOR_MEMORY=${S2I_SPARK_EXECUTOR_MEMORY:-"3900m"} | |
export S2I_SPARK_EXECUTORS=${S2I_SPARK_EXECUTORS:-"2"} | |
export S2I_SPARK_DRIVER_MEMORY=${S2I_SPARK_DRIVER_MEMORY:-"4g"} | |
export S2I_EMAIL_FROM=${S2I_EMAIL_FROM:-noreply@some.email.com} | |
export S2I_SMTP_SERVER=${S2I_SMTP_SERVER:-smtp.server.com:25} |
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
labels: | |
team: opendatahub | |
spec: | |
podMetricsEndpoints: | |
- interval: 30s | |
selector: | |
matchLabels: | |
team: opendatahub | |
spec: | |
podMonitorSelector: |
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
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1 | |
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' | |
RUN microdnf install nodejs npm nodejs-nodemon nss_wrapper \ | |
&& microdnf update \ | |
&& microdnf clean all \ | |
&& mkdir /deployments \ | |
&& chown 1001 /deployments \ | |
&& chmod "g+rwX" /deployments \ | |
&& chown 1001:root /deployments |
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
import pandas as pd | |
data = pd.DataFrame(list(range(100)), columns=["data"]) | |
pip install psycopg2 | |
import sqlalchemy | |
from sqlalchemy import create_engine | |
import psycopg2 |
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
def spark_jdbc_connect_structures( \ | |
sqltype, \ | |
host, \ | |
db, \ | |
user, \ | |
password, \ | |
driver = None, \ | |
port = None \ | |
): | |
sqltype = sqltype.lower() |
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
// XDouble, ToDouble, OpAuxDouble from singleton-ops | |
// Greater from refined | |
implicit def impliesGTGT[L, R, LD <: XDouble, RD <: XDouble](implicit | |
ld: OpAuxDouble[ToDouble[L], LD], | |
rd: OpAuxDouble[ToDouble[R], RD], | |
q: OpAuxBoolean[LD >= RD, true]): Greater[L] ==> Greater[R] = | |
new Implies[Greater[L], Greater[R]] {} |
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
scala> def foo[T <: Singleton](ce: T)(implicit tt: WeakTypeTag[T]): String = tt.tpe.toString | |
foo: [T <: Singleton](ce: T)(implicit tt: reflect.runtime.universe.WeakTypeTag[T])String | |
scala> foo(5) | |
res37: String = Int(5) | |
scala> foo("abc") | |
res38: String = String("abc") | |
scala> val x = 5 |
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
$ echo "try:" > eje.ipy | |
$ awk '{print " ", $0}' < simple.ipy >> eje.ipy | |
$ cat >> eje.ipy <<- EOF | |
> except Exception as e: | |
> print("===========") | |
> print(e) | |
> print("===========") | |
> EOF | |
$ ~/conda/bin/ipython eje.ipy | |
45 |
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
# SQL JDBC drivers can be downloaded from maven coords, if they are exposed that way. | |
# Otherwise they may be installed as naked jars and added to the path | |
import os | |
os.environ['PYSPARK_SUBMIT_ARGS'] = \ | |
# any other pyspark-shell args as well ... \ | |
"""--packages 'org.postgresql:postgresql:42.2.8,com.ibm.db2.jcc:db2jcc:db2jcc4' pyspark-shell""" | |
# attach to the spark cluster | |
spark = SparkSession.builder.master("spark://spark-cluster-poweruser:7077").getOrCreate() |