hres / cfg-task-service

Canada Food Guide Task Service
https://java-dev.hres.ca/cfg-task-service
MIT License
0 stars 1 forks source link

upload directory #12

Open rsanchej opened 6 years ago

rsanchej commented 6 years ago

@shussain I have created a service to upload rulesets files to the server. I have a variable that holds /var/tmp/rulesets as the directory where these uploads are placed. Let me know how you want to do this. A properties file?

So, the request is that the application will require a temporary directory where these uploads will be placed before being copied over to a permanent directory from where these rules will be acquired by the application, and these spaces will require the correct permissions so that the account running the app is allowed to perform the relevant operations. Thanks.

shussain commented 6 years ago

@rsanchej Thank you for giving context on what you are doing. It helps in making recommendations.

Rather than having a temp folder, perhaps a 'in progress' folder would be better?

rsanchej commented 6 years ago

By temp or in progress I mean a folder that all uploads go to: /var/tmp/rulesets

However, we need another folder where all these uploaded rules will be organized in a hierarchical fashion to be used/accessed by the application. The location for this other folder would have to be somewhere in the tomcat server so that these locations can be added to the CLASSPATH, say, unless there is another way of accomplishing this and not necessarily in the vicinity of tomcat. I will provide the exact details.

So, in the case of the in progress folder, when I run the upload service, the service will have sufficient permission to write to /var/tmp/rulesets on the filesystem.

shussain commented 6 years ago

Understood.

I will let @ayoung8 respond since the SOP is that he is primary for triaging and responding to design tickets.

ayoung8 commented 6 years ago

@rsanchej can you drop me an email with the specs of the files. e.g are the protected, who needs to access them, it'll make a difference in how/where the files can be saved will need to know for both temp and perm files, you should also check with IT Sec since this might impact the security classification of the application and therefore the hosting architecture

cpatey commented 6 years ago

Hi @ayoung8, The rule set files are not protected information. It is a set of excel file sheets that define how to classify foods to increase or decrease their rating. This was discussed with Mark Segstro at todays development and he confirmed this statement.

@rsanchej , please ensure the rest of the technical details are provided to Anthony so he can action this request as quickly as possible.

Thank you.

rsanchej commented 6 years ago

@ayoung8 Thanks. On the host where cfg-classification-service.war is deployed, create a directory /home/rulesets with permission of the tomcat account. /home/rulesets will be where the perm files will be stored. Likewise, create a directory /var/tmp/rulesets with permission of the tomcat account. This will be where the temp files get uploaded and eventually moved over to their permanent residency in /home/rulesets.

/var/tmp/rulesets will just be empty.

/home/rulesets/ has 1 subdirectory dtables/ which has 6 subdirectories (please these exact names):

refamt/
fop/
shortcut/
thresholds/
init/
tier/

and each of these directorys will have 16 directories (1 to 16):

1/ 2/ 3/ 4/ 5/ 6/ 7/ 8/ 9/ 10/ 11/ 12/ 13/ 14/ 15/ 16/

The exact hierarchy for /home/rulesets will be the following:

home
│
└── rulesets
    │
    └── dtables
        │
        ├── refamt
        │   │
        │   ├── 1
        │   ├── 2
        │   ├── 3
        │   ├── 4
        │   ├── 5
        │   ├── 6
        │   ├── 7
        │   ├── 8
        │   ├── 9
        │   ├── 10
        │   ├── 11
        │   ├── 12
        │   ├── 13
        │   ├── 14
        │   ├── 15
        │   └── 16
        │
        ├── fop
        │   │
        │   ├── 1
        │   ├── 2
        │   ├── 3
        │   ├── 4
        │   ├── 5
        │   ├── 6
        │   ├── 7
        │   ├── 8
        │   ├── 9
        │   ├── 10
        │   ├── 11
        │   ├── 12
        │   ├── 13
        │   ├── 14
        │   ├── 15
        │   └── 16
        │
        ├── shortcut
        │   │
        │   ├── 1
        │   ├── 2
        │   ├── 3
        │   ├── 4
        │   ├── 5
        │   ├── 6
        │   ├── 7
        │   ├── 8
        │   ├── 9
        │   ├── 10
        │   ├── 11
        │   ├── 12
        │   ├── 13
        │   ├── 14
        │   ├── 15
        │   └── 16
        │
        ├── thresholds
        │   │
        │   ├── 1
        │   ├── 2
        │   ├── 3
        │   ├── 4
        │   ├── 5
        │   ├── 6
        │   ├── 7
        │   ├── 8
        │   ├── 9
        │   ├── 10
        │   ├── 11
        │   ├── 12
        │   ├── 13
        │   ├── 14
        │   ├── 15
        │   └── 16
        │
        ├── init
        │   │
        │   ├── 1
        │   ├── 2
        │   ├── 3
        │   ├── 4
        │   ├── 5
        │   ├── 6
        │   ├── 7
        │   ├── 8
        │   ├── 9
        │   ├── 10
        │   ├── 11
        │   ├── 12
        │   ├── 13
        │   ├── 14
        │   ├── 15
        │   └── 16
        │
        └── tier
            │
            ├── 1
            ├── 2
            ├── 3
            ├── 4
            ├── 5
            ├── 6
            ├── 7
            ├── 8
            ├── 9
            ├── 10
            ├── 11
            ├── 12
            ├── 13
            ├── 14
            ├── 15
            └── 16
rsanchej commented 6 years ago

@ayoung8 please clone https://github.com/rsanchej/cfg-classification-rulesets to an official hres repository https://github.com/hres/cfg-classification-rulesets.

rsanchej commented 6 years ago

@ayoung8 please give @rsanchej permission to contribute to cfg-classification-rulesets

@rsanchej was unable to update README.md

ayoung8 commented 6 years ago

Repo cloned Permissions granted repo deployed to /opt/ruleset/ Note: When looking in the master branch of task service there is a hard coded path: private static final String FOLDER_PATH = "/var/tmp/rulesets/"; therefore the ruleset will likely not work due to being in the wrong path

Please close issue if complete

ayoung8 commented 6 years ago

** though not sure if its for task service or for another part of cfg ... in either case please update path as required for ruleset to function

rsanchej commented 6 years ago

@ayoung8, cfg-classification-rulesets is deployed to /opt/ruleset/ so that the property in rulesets.properties reads:

RULESETS_HOME=/opt/ruleset/cfg-classification-rulesets/rulesets