!KVoBNluBfuYwmyBJsy:matrix.org

cylc ops

23 Members
Ansible, Docker, Singularity, and other sysadmin/ops topics involving Cylc4 Servers

Load older messages


SenderMessageTime
4 Aug 2021
@b:yesbut.xyzb

i tried

      - type: bind
        source: ./global.rc
        target: /etc/global.rc
      - "./global.rc:/etc/global.rc"
      - "$(pwd)/global.rc/etc/global.rc" 
01:12:19
@kinow:matrix.org@kinow:matrix.org I think you can use volumes for directories only. The latest cylc reads the global.rc from /etc/cylc/. So you should be able to bind some local folder with your global.rc to /etc/cylc/ 01:12:47
@b:yesbut.xyzball of them cause docker to create a empty directory in its place01:12:53
@kinow:matrix.org@kinow:matrix.org(I'm checking my folders to confirm .... )01:12:54
@b:yesbut.xyzb
In reply to @kinow:matrix.org
I think you can use volumes for directories only. The latest cylc reads the global.rc from /etc/cylc/. So you should be able to bind some local folder with your global.rc to /etc/cylc/
yeah, thats why they have the --mount option, but it seems like I cant find its equivalent in docker-compose
01:13:40
@b:yesbut.xyzb
If you use --mount[...] Docker does not automatically create it for you, but generates an error.
01:14:07
@kinow:matrix.org@kinow:matrix.org
      - type: bind
        source: ./config/
        target: /etc/cylc/
01:14:23
@kinow:matrix.org@kinow:matrix.org Something like this I think ☝️ where you have your configuration files inside your local config folder. 01:14:44
@kinow:matrix.org@kinow:matrix.orgI'm just trying to confirm where Cylc looks for files.... 01:15:05
@b:yesbut.xyzbyeah, binding the full directory ofc is possible 01:15:16
@b:yesbut.xyzbI wanted to just mount the one file 01:15:34
@b:yesbut.xyzbbut seems like i need to go directory01:15:41
@b:yesbut.xyzbjust confused there s a run option, but nothing for compose01:16:10
@kinow:matrix.org@kinow:matrix.orgAh, what if you pass the absolute directory of your file???01:16:18
@kinow:matrix.org@kinow:matrix.orgYou are passing the relative location.. I think the absolute location might work?01:16:44
@kinow:matrix.org@kinow:matrix.org I remember having a similar issue with docker exec I think, and I was using -v localfile:blabla, and had to replace by ${PWD} 01:17:16
@kinow:matrix.org@kinow:matrix.org * I remember having a similar issue with docker exec I think, and I was using -v localfile:blabla, and had to replace by ${PWD}/localfile 01:17:23
@b:yesbut.xyzbhm, i think it is the same for an absolute path 01:18:15
@b:yesbut.xyzbif using exec or some i can really recommend using --mount 01:18:32
@b:yesbut.xyzblike explained in the link I snet 01:18:45
@b:yesbut.xyzb * like explained in the link I sent 01:18:48
@b:yesbut.xyzban absolute path isnt working either 01:19:52
@b:yesbut.xyzb *

hey guys - i have a question regarding using the --mount option in dokcer-compose, since i want to link a file without docker creating it for me if it doesnt exist on the host (https://docs.docker.com/storage/bind-mounts/#choose-the--v-or---mount-flag)

If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory.
If you use --mount to bind-mount a file or directory that does not yet exist on the Docker host, Docker does not automatically create it for you, but generates an error.

01:24:19
@kinow:matrix.org@kinow:matrix.org

Here's what I tried:

kinow@ranma:/tmp/test-docker$ mkdir -p /tmp/test-docker && cd /tmp/test-docker
kinow@ranma:/tmp/test-docker$ echo "TEST" > global.rc
kinow@ranma:/tmp/test-docker$ docker run --rm -ti --mount type=bind,source="${PWD}/global.rc",target=/etc/global.rc debian:stable-slim /bin/bash
root@0ad09b680674:/# cat /etc/global.rc
TEST
root@0ad09b680674:/# exit

Then wrote this docker-compose.yml

version: "3"
services:
  cylc:
    image: "debian:stable-slim"
    volumes:
      - ${PWD}/global.rc:/etc/global.rc

And tested with:

kinow@ranma:/tmp/test-docker$ docker-compose run --rm cylc
root@cd233da49027:/# cat /etc/global.rc
TEST
root@cd233da49027:/# exit
01:37:16
@kinow:matrix.org@kinow:matrix.orgNow trying the volume from your example...01:37:27
@kinow:matrix.org@kinow:matrix.org
kinow@ranma:/tmp/test-docker$ cat docker-compose.yml 
version: "3.3"
services:
  cylc:
    image: "debian:stable-slim"
    volumes:
      - type: bind
        source: "${PWD}/global.rc"
        target: "/etc/global.rc"
kinow@ranma:/tmp/test-docker$
kinow@ranma:/tmp/test-docker$
kinow@ranma:/tmp/test-docker$ docker-compose run --rm cylc
root@a92b834ddc3c:/# cat /etc/global.rc
TEST
root@a92b834ddc3c:/# exit
01:41:21
@kinow:matrix.org@kinow:matrix.org Is that similar to what you are trying to do b ? 01:41:35
@b:yesbut.xyzbyes01:42:35
19 Oct 2021
@kinow:matrix.org@kinow:matrix.org left the room.20:57:18
19 Nov 2021
@mukeshbhakuni:matrix.orgmukesh bhakuni joined the room.19:01:47

Show newer messages


Back to Room ListRoom Version: 4