Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Add network to docker containers #43

@sdave2

Description

@sdave2

I am testing/trying out fiber from my local machine. I am looking to use fiber processes to do a side-effect job (put data into databases) and use docker as the fiber backend. For testing, i have elasticsearch and postgress running in docker containers in a docker network called test.
I would like to pass network name as a parameter (just like the docker image) to the process running the docker container.
I tried it out locally and it works for me. This is the modification i made to the docker_backend.py file:

     81         try:
     82             container = self.client.containers.run(
     83                 image,
     84                 job_spec.command,
     85                 name=job_spec.name + '-' + str(uuid.uuid4()),
     86                 volumes=volumes,
     87                 cap_add=["SYS_PTRACE"],
     88                 tty=tty,
     89                 stdin_open=stdin_open,
     **90                 network="test",**
     91                 detach=True

I am not sure how to pass the network in as a parameter. Possibly via job_spec ?

Questions:

  1. Is it recommend to use Fiber process to do side-effect jobs, specifically use it and insert data into database?
    If i have 5 places i want to put the data in (elasticsearch, redis-stream, postgress, other-places), is it recommend to use 5 fiber processes to insert data into the respective "databases"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions