DLI Course ‘Building RAG Agents for LLMs’ -Building the Container for the Course Setup

Hello community!

I’ve downloaded all the folders for the course, and the structure looks like this:

├── course
│   ├── 00_jupyterlab.ipynb
│   ├── 01_microservices.ipynb
(...)
│   ├── composer
│   ├── docker_router
│   ├── env
│   ├── frontend
│   ├── imgs
│   ├── llm_client
│   └── solutions

I’m trying to figure out how to properly build the containers in my localhost. The file course/composer/docker-compose.yml mentions the following:

version: '2.3'

## To Build The Repo: Execute the following command from directory ABOVE notebook repository
## Dev Environment:  docker-compose build && docker-compose up -d
## Prod Environment: docker-compose -f docker-compose.yml -f docker-compose.deployment.yml build && ...

It also mentions that the frontend and assessment microservices share a volume, where the frontend writes a file, and the assessment microservice uses that to give credit.

This suggests a specific directory structure or setup for building. Could anyone confirm how to correctly build the container and run the services in this setup? Any specific directory I should be running the commands from?

Thanks in advance!

Hey @igorparrabastias!

Consider the following snippet:

  lab:
    container_name: jupyter-notebook-server  
    init: true
    volumes:  ## Allow /dli/task in container to reference ./notebooks/ in host
      - ./notebooks/:/dli/task/
  
  ## ...

  ## Deliver your llm_client microservice
  llm_client:
    container_name: llm_client
    volumes:
      - ./notebooks/llm_client:/llm_client
    ports:
      - "9000:9000"
    env_file:
      - .env  ## pass in your environment variable (i.e. NVIDIA_API_KEY)
      ## This file belongs ABOVE the notebooks directory
      # COMPOSE_PROJECT_NAME=c-fx-15-v1
      # DEV_NGINX_PORT=80
      # DEV_ASSESSMENT_PORT=81
      # NVIDIA_API_KEY=nvapi-...  ## To be filled in
# ...

  ## Reverse-proxy (serving the front page) service
  nginx:
    image: nginx:1.15.12-alpine
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf
    depends_on:
      - lab

Per the volume specification, ./notebooks as relative to the compose.yml file is the default directory which contains everything that should be accessible inside the lab environment. The later services also have files which need to be above ./notebooks to be accessible from the compose.ymls.

├── .env
├── docker-compose.yml
├── docker-compose.override.yml
├── nginx.conf
├── notebooks
│   ├── 00_jupyterlab.ipynb
│   ├── 01_microservices.ipynb
(...)
│   ├── composer
│   ├── docker_router
│   ├── frontend
│   ├── llm_client
│   └── solutions

Fair warning; I don’t test this workflow out often, but I try to keep it up-to-date and it looks good to me right now.

Let me know if you run into any issues or have any questions!

That works. Thanks !

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.