RMI-PACTA / pactaCore

Tools to Calculate Climate Targets for Equity and Corporate Bond Portfolios
Other
0 stars 1 forks source link

Give host output permissions #34

Closed jdhoffa closed 3 years ago

jdhoffa commented 3 years ago

Here I recursively chmod 774 the working_dir folder in bin/run-pacta.

This will give the following permissions:

Since bin/run-pacta is run inside the docker container, this gives that directory those permissions within the container.

One open question I have: I wonder if this approach would be different depending on the mounting type (volume or bind).

Maybe closes #22

jdhoffa commented 3 years ago

FYI, what I see locally

The steps I follow to run the Dockerfile are (from within pactaCore):

bin/setup-io
docker-compose up --build

The output folder created by bin/setup-io (prior to being populated with data) is (prior to running docker): Screenshot 2021-08-13 at 14 03 57

The output folder after: Screenshot 2021-08-13 at 14 15 34

Confusingly, even though I pass the -R flag, the recursive files don't seem to have the same permissions: Screenshot 2021-08-13 at 14 16 12

I leave this as a draft, since it seems I haven't solved the problem.

jdhoffa commented 3 years ago

A conversation with @maurolepore seems to suggest that this has been solved? Closing for now.

maurolepore commented 3 years ago

For the record, right now this is done here: We get the permissions from the input/ directory in the host computer (mounted) and apply them recursively to all files in the output/ directory in the container -- which then gets copied to the host computer.

As the input/ directory in the host computer is created by the user, they have full access; this process ensures they also have full access to the resulting output/ directory.