-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace custom ODK submission media upload with official external storage (S3) #1894
Conversation
ac99aa0
to
df2d5e4
Compare
026e4bb
to
b78e2aa
Compare
df2d5e4
to
b8a6ad0
Compare
36c0a90
to
53dd8a4
Compare
Work in progress on this osm-fieldwork branch https://github.com/hotosm/osm-fieldwork/tree/feat/submission-attachment-urls
Here we need to be able to get all pre-signed URLs for submission photos from ODK Central. Then we can work on integrating into FMTM and replace the existing custom code to upload S3. |
Should be working now after latest pushes π Let's merge and test this on dev! The tests fail as we need to build new ODK images (latest version), but to do that we need to merge first π |
I will test and merge then |
I am gettings image contents (bytes) instead of url. |
There is another issue as well, i can't create project. |
But have the images actually been uploaded to S3? See the PR description for the command that needs to be run in ODK first. Although it would probably be nice to return an informative error from the osm-fieldwork method. Or do something with the blob if the photo isn't transferred to S3 yet |
Please raise as a separate issue π An internesting one - I managed to publish forms after that change, so it suggested its extra validation introduced in the Central upgrade. Easy to remove that save_to though |
so i need to run that command to upload image after submission? I did that
|
yes it might be new validation, we can remove that. |
Hmm that's strange. Could be a few reasons. More info here: https://docs.getodk.org/central-install-digital-ocean/#using-s3-compatible-storage Perhaps already uploaded? You can check with |
Where are you testing this? On the dev Central instance? This sort of PR needs to be tested on the local ODK instance, as it includes changes to Central that won't be present on dev until this is merged. The error you posted suggests the server doesn't have an S3 bucket configured to upload correctly (which makes sense) |
No i tested on my local ODK instance. |
Extra strange then!
|
sorry i may not have understood what you meant to say "Dev odk instance"? do you mean dev server's odk central docker service? or dev odk configuration during project creation? (odk.dev.hotosm.org)? |
Dev = odk.dev.fmtm.hotosm.org (remote) Local dev (or just local) = odk.fmtm.localhost (on your machine) The remote dev instance isn't configured for S3 until this PR is merged. Testing on local should work though π |
Ah i was using odk.dev server then, i will test using local instance. |
Its more tricky to do that - I was considering arranging a call tomorrow to discuss using ODK tunnel config I set up (for submissions to local ODK) π For now, we may as well merge this and test it on the remote dev (easier / will save you time) |
yeah lets merge this then it will be easier to test on dev |
What type of PR is this? (check all applicable)
Related Issue
Related to
#1875
#1701
will impact
#1706
Describe this PR
docker exec -it fmtm-central-1
node lib/bin/s3.js upload-pending
node lib/bin/s3.js reset-failed-to-pending
Review Guide
Notes for the reviewer. How to test this change?
Checklist before requesting a review
[optional] What gif best describes this PR or how it makes you feel?