Commit 9d33fcb8 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Merge branch 'testing'

parents 4713723c 11423a8f
Loading
Loading
Loading
Loading

docker/README.txt

0 → 100644
+56 −0
Original line number Diff line number Diff line
Simple communication test that involes 4 docker containers:
- AMQP client (container_name: test_client, file to run test_client.py)
- AMQP server (container_name: transfer_service)
- RabbitMQ (container_name: rabbitmq)
- Redis (container_name: redis)

Furthermore, other 2 containers have been added:
- Tape library frontend, a.k.a. Lenovo (container_name: tape_frontend)
- Transfer node (container_name: transfer_node)

Start the whole environment with (launch the command from the 'docker' dir):
$ docker-compose up

Once all the containers are up and running, open another shell and access the test_client container:
$ docker exec -it test_client /bin/bash

At this point you can launch the test_client.py within the test_client container:
$ python test_client.py

The output should be something like this:

     test_client@6a11611d604f:~$ python test_client.py 
     Sending transfer request...
     Response:
     {
        "jobID": "b85e3fb8db0b11ea8d110242c0a8d006",
        "phase": "RUN",
        "quote": null,
        "startTime": null,
        "endTime": null,
        "executionDuration": null,
        "destruction": null,
        "parameters": null,
        "jobInfo": {
           "transfer": {
              "@version": "2.1",
              "target": "vos://example.com!vospace/mydata1",
              "direction": "pullFromVoSpace",
              "protocol": {
                 "@uri": "ivo://ivoa.net/vospace/core#httpget"
              }
           }
        }
     }

You can access the rabbitmq web interface via browser:
    1) Find the IP address of the RabbitMQ broker:
    $ docker network inspect docker_vospace_backend_net | grep -i -A 3 rabbitmq
    2) Open your browser and point it to http://IP_ADDRESS:15672 (user: guest, password: guest)
    
 Stop the whole environment with:
 $ docker-compose down
 
 Cleanup:
 $ docker image prune -a
 $ docker volume prune
 No newline at end of file
+56 −0
Original line number Diff line number Diff line
version: '2.0'
services:
  redis:
    image: redis
    container_name: redis
    networks:
    - vospace_backend_net
    ports:
    - "6379:6379"
  rabbitmq:
    image: rabbitmq:3-management
    container_name: rabbitmq
    depends_on:
    - redis
    networks:
    - vospace_backend_net
    ports:
    - "5672:5672"
    - "15672:15672"
    stdin_open: true
    tty: true
  tape_frontend:
    build: ./tape_frontend
    container_name: tape_frontend
    networks:
    - vospace_backend_net
    stdin_open: true
    tty: true
  transfer_node:
    build: ./transfer_node
    container_name: transfer_node
    depends_on:
    - tape_frontend
    networks:
    - vospace_backend_net
    stdin_open: true
    tty: true
  transfer_service:
    build: ./transfer_service
    container_name: transfer_service
    depends_on:
    - rabbitmq
    networks:
    - vospace_backend_net
    stdin_open: true
    tty: true
    command: ["./wait-for-it.sh", "rabbitmq:5672", "--", "python3", "transfer_service.py"]
  test_client:
    build: ./test_client
    container_name: test_client
    networks:
    - vospace_backend_net
    stdin_open: true
    tty: true
networks:
  vospace_backend_net:
+38 −0
Original line number Diff line number Diff line
# Use CentOS 7 as base image
FROM centos:7

# Check for updates and install them
RUN yum -y update

# Install epel repo
RUN yum -y install epel-release

# Install xrootd-server package and python bindings
RUN yum -y install xrootd-server python36-xrootd

# Copy authentication directives config file and set the right permissions
COPY auth_file /etc/xrootd/
RUN chown xrootd:xrootd /etc/xrootd/auth_file && \
    chmod 0644 /etc/xrootd/auth_file

# Create a new user called centos, create the home directory and set the default shell
RUN useradd -m -s /bin/bash centos

# Switch to centos user
USER centos

# Set home environment variable
ENV HOME=/home/centos/

# Set the HOME as working directory
WORKDIR $HOME

# Copy xrootd main config file into the current work dir
COPY xrootd.cfg .

# Create a dir with some data to expose
RUN mkdir data
COPY aaa ./data/aaa

# Execute xrootd service to expose data
CMD /bin/xrootd -c xrootd.cfg ${HOME}/data
+0 −0

Empty file added.

+1 −0
Original line number Diff line number Diff line
1 
Loading