Assessment Lab: Working with Data Science Projects
In this lab, you will practice the use of data science projects, permissions, workbenches, environment variables, and data connections.
Prerequisites
To perform this lab, ensure that your platform meets the following conditions:
-
An S3 bucket. If you do not have an S3 object store available, follow the guide to create an S3 bucket by using Minio.
-
The
data-scientists
user group exists in OpenShift.To create the
data-scientists
group, log in as a user with administrator privilege in OpenShift and then apply the https://raw.githubusercontent.com/RedHatQuickCourses/rhods-qc-apps/main/1.intro/chapter2/lab/group.yaml file:apiVersion: user.openshift.io/v1 kind: Group metadata: name: data-scientists users: - user4 - user5
If you use the
oc
CLI in your computer or terminal from OpenShift web console, then you can run:$ oc create -f \ https://raw.githubusercontent.com/RedHatQuickCourses/rhods-qc-apps/main/1.intro/chapter2/lab/group.yaml
-
The
user4
anduser5
users exist in OpenShift and are assigned to thedata-scientists
group. -
The
oc
CLI installed on your computer. Alternatively, you can use the OpenShift web console.
The identity provider of your demo platform already includes these users (user4
and user5
).
Specifications
-
Create two data science projects as
user1
:intro-projects-a
andintro-projects-b
. -
Create a workbench in
intro-projects-a
.-
Use the
Standard Data Science
image. -
This workbench must be connected to the S3 bucket that is available in your demo platform.
-
Clone the https://github.com/RedHatQuickCourses/rhods-qc-apps repository in this workbench.
-
Execute the
rhods-qc-apps/1.intro/chapter2/lab/test_connection.ipynb
notebook in this workbench. This notebook contains code to verify that the connection to S3.
-
-
Create a workbench in
intro-projects-b
.-
Select any image for this workbench.
-
Pass your name in the
STUDENT_NAME
environment variable. -
Clone the https://github.com/RedHatQuickCourses/rhods-qc-apps repository in this workbench.
-
Execute the
rhods-qc-apps/1.intro/chapter2/lab/test_env_vars.ipynb
notebook in this workbench. This notebook contains code to read the environment variable.
-
-
The
data-scientists
group must have edit permissions inintro-projects-a
. -
Only the
user4
user must have edit permissions inintro-projects-b
.
Solution
-
Create the projects.
-
Login as the
user1
to Red Hat OpenShift AI console. -
From your RHOAI dashboard, click Data Science Projects in the left navigation pane.
-
In the Data science projects page, click Create data science project.
-
Enter
intro-projects-a
as the project name and click Create. -
Repeat the same steps to create
intro-projects-b
.
-
-
Create a workbench connected to S3 in
intro-projects-a
.-
Navigate the
intro-projects-a
dashboard and click Create workbench. In the workbench creation page, enter the workbench name, select the workbench image asStandard Data Science
image, and the image version. -
Select Small as the container size.
-
In the Data connections section, select Use a data connection.
-
Enter the configuration values of your S3 connection.
-
Click Create workbench to finish the creation of the workbench and the data connection.
-
-
Verify the connection of the workbench in
intro-projects-a
.-
Open the workbench of the
intro-projects-a
project. -
Log in as
user1
to JupyterLab and accept the access form. -
Clone the https://github.com/RedHatQuickCourses/rhods-qc-apps repository.
-
Navigate to
rhods-qc-apps/1.intro/chapter2/lab
and run thetest_connection.ipynb
notebook. You should see the buckets available in S3.
-
-
Create a workbench that receives the
STUDENT_NAME
environment variable inintro-projects-b
.-
Navigate the
intro-projects-b
dashboard and click Create workbench. In the workbench creation page, enter the workbench name, select the workbench image asStandard Data Science
image, and the image version. -
Select Small as the container size.
-
In the Environment variables section, click Add variable.
-
Select Config Map as the environment variable type. Then select Key/value.
-
Enter
STUDENT_NAME
as the key, and your name as the value. -
Click Create workbench to finish the creation of the workbench and the data connection.
-
-
Verify the variable injected in the workbench in
intro-projects-b
.-
Open the workbench of the
intro-projects-b
project. -
Log in as
user1
to JupyterLab and accept the access form. -
Clone the https://github.com/RedHatQuickCourses/rhods-qc-apps repository.
-
Navigate to
rhods-qc-apps/1.intro/chapter2/lab
and run thetest_env_vars.ipynb
notebook. You should see a hello message that includes your name.
-
-
Set the project permissions of
intro-projects-a
.-
Navigate the
intro-projects-a
dashboard and click Permissions. -
Click Add group and enter
data-scientists
as the group name. Verify that the Permission selector is set to Edit and click the ✓ button. -
Log out and log back in with both
user4
anduser5
users. Verify that both users have access to theintro-projects-a
project.
-
-
Set the project permissions of
intro-projects-b
.-
Log out and log back in as
user1
. -
Navigate the
intro-projects-b
dashboard and click Permissions. -
Click Add user and enter
user4
as the username. Verify that the Permission selector is set to Edit and click the ✓ button. -
Log out and log back in with both
user4
anduser5
users. Verify thatuser4
can access theintro-projects-b
project. Next, verify thatuser5
cannot access theintro-projects-b
project.
-