Created 06-09-2025 01:54 AM
Hi guys,
i hope you are doing well.
can you please help me to get the root access in the container of the session in CDWS?
best wishes,
salim
Created 06-09-2025 11:53 AM
@SalimAlhajri Welcome to the Cloudera Community!
To help you get the best possible solution, I have tagged our CDSW experts @Mike @Gopinath who may be able to assist you further.
Please keep us updated on your post, and we hope you find a satisfactory solution to your query.
Regards,
Diana Torres,Created 06-09-2025 09:50 PM
Dear Diana,
Many thanks for your support.
best wishes,
Salim
Created 06-10-2025 04:35 PM
Hi Salim, you cannot access root in the containers - this is due to security concerns. Sometimes customers need root to install something from pip (some pip libraries need make, for instance.) If that's the case, you'll need to create a custom Runtime (or Legacy Engine if you are still on CDSW) and install those libraries when you create the image - at creation time, you will have root.
SEe here: https://docs.cloudera.com/machine-learning/cloud/runtimes/topics/ml-customized-runtimes.html
Here is another example of a "dockerfile" and you can see that basically you can install anything in the Runtime(engine) container:
https://github.com/cloudera/community-ml-runtimes/blob/main/ollama/Dockerfile
Created 06-10-2025 10:52 PM
Dear Mike,
Thank you for your support.
I would like to highlight that I do not have internet access within CDSW, as our Cloudera environment is fully air-gapped.
From your previous message, I understand that you are suggesting I create a custom Docker image and run it accordingly. I have already created a custom Docker image — however, I would appreciate it if you could review it and provide your feedback.
Additionally, could you clarify your expectations regarding the base operating system for the container image? and the Base image?
For your reference, we are using CDSW version 1.10.5.
Best wishes,
Salim
### **Description of the Docker Image**
This Docker image is a **customized environment** tailored for Cloudera Data Science Workbench (CDSW) in an **air-gapped (offline)** setting. It includes the following components:
1. **Base Image**:
- Starts with `docker.repository.cloudera.com/cdsw/engine:8` , ensuring compatibility with CDSW.
2. **Operating System**:
- **Ubuntu 20.04 LTS**, a lightweight and stable Linux distribution.
3. **MySQL 8.0.4**:
- A milestone release of MySQL, installed from pre-downloaded `.deb` packages (no internet required).
4. **Python 3.8.18**:
- Compiled from source to ensure version compatibility.
5. **Node.js 22.16.0**:
- Installed via a pre-extracted binary archive.
6. **Grafana Enterprise 11.6.0**:
- Installed using a `.deb` package for enterprise-grade monitoring.
7. **Ollama**:
- A pre-downloaded binary for running large language models locally.
8. **Python Packages**:
- Installed **offline** from a pre-downloaded `requirements.txt` file and local wheels (`.whl` or `.tar.gz`) .
9. **Exposed Ports**:
- MySQL (3306), Python apps (8000), Grafana (3000), and Ollama (11434).
---
### **Requirements to Build the Image**
To build this image in an **air-gapped environment**, you must pre-download and include the following:
1. **Pre-downloaded Dependencies**:
- **MySQL 8.0.4 `.deb` packages** (from Cloudera or MySQL archives).
- **Python 3.8.18 source tarball** (from [python.org](https://www.python.org/ftp/python/3.8.18/)).
- **Node.js 22.16.0 Linux x64 binary** (from [nodejs.org](https://nodejs.org/dist/v22.16.0/)).
- **Grafana Enterprise 11.6.0 `.deb` package** (from Grafana’s enterprise download page).
- **Ollama binary** (from [ollama.ai/download](https://ollama.ai/download)).
2. **Offline Python Packages**:
- Use `pip download -r requirements.txt -d python_packages/` in an online environment to fetch all dependencies locally .
3. **Directory Structure**:
Ensure the following files/directories exist in the build context:
```bash
.
├── Dockerfile
├── requirements.txt
├── ollama # Pre-downloaded Ollama binary
└── dependencies/
├── mysql-8.0.4/ # MySQL .deb packages
├── python/ # Python 3.8.18 source
├── node-v22.16.0-linux-x64.tar.xz
├── grafana-enterprise-11.6.0.deb
└── python_packages/ # Pre-downloaded Python wheels
```
4. **Build Command**:
Run:
```bash
docker build -t custom-cdsw:latest .
```
5. **Push to Private Registry (Optional)**:
For CDSW integration, push the image to a registry accessible by CDSW:
```bash
docker tag custom-cdsw:latest <your-registry>/custom-cdsw:latest
docker push <your-registry>/custom-cdsw:latest
```
---
### **Key References**
- Docker images contain application code, libraries, tools, and dependencies .
- Use `docker inspect` to view details about the image .
- Dockerfiles are often shared in repositories for transparency .
Let me know if you need further clarification!