Custom agent image not work


I follow Configure agents | Datalore Documentation, and built my own image and tag it like


and configurated to use it in agents-config.yaml, like

  network: datalore-agents-network
  dataloreHost: datalore
    - my-agent
      image:  localhost:5000/my-agent:2023.1

and the machine type my-agent show in dropdown list,
however, when chosing to use this type,
the machine never get start successfully.
can anyone help:

  1. where can i find the log about the agent machine starting detail?
  2. what is the correct image url for local image?

The default given in the documentation works all right for me.

hi barcastaff,

could you give me some process detail on how you built the agent docker image, and an example of agents-config.yaml file?

many thanks.

Something like this:

  network: datalore-agents-network
  dataloreHost: datalore
    - id: 1
      default: true
      label: "your-name"
      description: "your-description"
        # I put in a GPU here. You don't have to.

Everything is basically the default recommendation from the documentation.

finally i made it out, it is something conflict on my image definition(I guess).
for anyone come across this, following is my procedure:

  1. build image using “docker build -t my-agent:xxx .”
    1.1 becareful with the Dockerfile content(I am not quite sure and not know the cause, but it did help me)
    * not to change the owner of path /home/datalore
    * change back user to datalore (DO NOT leave root in last statement)
    1.2 make small steps every time in the Dockerfiler, and give enough test(build and start machine using the custom image)
    1.3 some experiences:
    * for programe need to create path in home dir, use root to mkdir then chown the path, and change back to datalore
    the Dockerfile example:
FROM jetbrains/datalore-agent:2023.1
LABEL maintainer="xxxx"

USER root
RUN mkdir -p /opt/software
RUN chown datalore:datalore /opt/software
# end of ====tag:mkdir======

USER datalore

# RUN curl -LO
COPY --chown=datalore:datalore ./spark-3.3.0-bin-hadoop3-scala2.13.tgz /opt/software
RUN tar -xvf /opt/software/spark-3.3.0-bin-hadoop3-scala2.13.tgz -C /opt/software
RUN ln -s /opt/software/spark-3.3.0-bin-hadoop3-scala2.13 /opt/software/spark
ENV SPARK_HOME=/opt/software/spark

USER datalore
# RUN /opt/python/envs/minimal/bin/pip install pyspark==3.3.0
COPY ./pyspark-3.3.0.tar.gz /opt/software
RUN /opt/python/envs/minimal/bin/pip install /opt/software/pyspark-3.3.0.tar.gz
# end of ====tag:spark======

USER datalore
# RUN /opt/python/envs/minimal/bin/pip install playwright==1.31.1
COPY ./playwright-1.30.0-py3-none-manylinux1_x86_64.whl /opt/software
RUN /opt/python/envs/minimal/bin/pip install /opt/software/playwright-1.30.0-py3-none-manylinux1_x86_64.whl
USER root
RUN mkdir -p /home/datalore/.cache
RUN chown datalore:datalore /home/datalore/.cache
USER datalore
RUN /opt/python/envs/minimal/bin/playwright install chromium
# end of ====tag:playwright======
  1. tag the image to another name and use it in the agents-config.yaml
    • using mounted volume in docker-compose.yaml(not agents-config, it is used by datalore server not agent) to do this , docker compose file like
version: "3.9"
    image: jetbrains/datalore-server:2023.1
      - "18082:8080"
    expose: [ "8081", "5050", "4060" ]
      - datalore-agents-network
      - datalore-backend-network
      - ./dldata:/opt/data
      - /var/run/docker.sock:/var/run/docker.sock
      - ./datalore-agent/agents-config.yaml:/opt/datalore/configs/agents-config.yaml
1 Like