-
Notifications
You must be signed in to change notification settings - Fork 208
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
Cloud Export integration, saving & display #1192
Conversation
Code Climate has analyzed commit 9a26a4d and detected 0 issues on this pull request. View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## main #1192 +/- ##
=======================================
Coverage 73.28% 73.28%
=======================================
Files 40 40
Lines 1400 1400
=======================================
Hits 1026 1026
Misses 374 374
|
I was able to get this running locally but was blocked by a CORS limitation:
I'm surprised -- this is working elsewhere. Checking with @icarito on this... |
Hm, yeah - it should work: https://github.com/publiclab/mapknitter-exporter-sinatra/pull/44/files#diff-cc95738088603531796e0d0f246a5d77R20 we allow |
Maybe we need to allow different ports? |
Also having trouble getting it to build at https://jenkins.laboratoriopublico.org/job/Mapknitter-Unstable/ |
Checking the issue in building looks the same as Mapknitter-Stable |
I was able to reproduce in the command line, looking for a fix |
I figured it out, it was a permissions issue! Apparently somewhere in the process we create files by root? I've chowned them and it should work now - will keep an eye to see at what part of the process it happens again. |
Okay so this branch is running in unstable staging branch. Stable is running also. |
I guess there are no debugging symbols in our passenger build but GDB reports this:
|
I got a sentry notice of a migration that didn't run, fwded it. Not sure if
related!
…On Fri, Jan 10, 2020, 8:24 PM Sebastian Silva ***@***.***> wrote:
I guess there are no debugging symbols in our passenger build but GDB
reports this:
Core was generated by `Passenger AppPreloader: /app (forking...) '.
Program terminated with signal SIGABRT, Aborted.
#0 0x00007fc4e85b3fff in ?? ()
(gdb) bt
#0 0x00007fc4e85b3fff in ?? ()
#1 0x0000000000000000 in ?? ()
(gdb)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1192?email_source=notifications&email_token=AAAF6J5LA35BR5RGEGFOWJTQ5ENUJA5CNFSM4KFOBK22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIVVH4I#issuecomment-573264881>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J2E2SZJOQHGDEZICTDQ5ENUJANCNFSM4KFOBK2Q>
.
|
Sentry issue: MAPKNITTER-M |
Hm. I'm still getting this locally:
Ah, i bet the 500 error is causing the CORS error, i think that happened before. Let me check, i bet the format is not quite right. |
ah yes, it's because my images are local, so the exporter can't read them. I guess i have to test on unstable. |
// exportUrl: 'http://34.74.118.242/api/v2/export/', // to swap to JS exporter | ||
// exportStartUrl: 'http://34.74.118.242/api/v2/export/', // to swap to JS exporter | ||
// fetchStatusUrl: fetchStatusUrl, | ||
handleStatusResponse: handleStatusResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not clear to me that this is getting used; need to console.log a bit.
|
||
// save the location of the status URL | ||
$.ajax({ | ||
url: "/export", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for example this doesn't seem to be running...
Syncing this with publiclab/Leaflet.DistortableImage#519 too cc @sashadev-sky -- thanks! |
If folks could try this out it'd be great cc @VladimirMikulic @cesswairimu shift-select the images and press the export button in upper left of the map. Also, the Exports => Exports tab should show exports you've started from that page... they won't properly run from local maps, so heads up. Almost there! I'll try to pull in the latest LDI version too! |
@jywarren I've started a few exports but they are not shown in the "Exports" tab. No console errors. |
Ah, in this initial implementation they're only showing on page refresh.
But a later refactor won't be hard!
…On Mon, Jan 13, 2020, 6:43 PM Vladimir Mikulic ***@***.***> wrote:
@jywarren <https://github.com/jywarren> I've started a few exports but
they are not shown in the "Exports" tab. No console errors.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1192?email_source=notifications&email_token=AAAF6J2ICXJSW4QPHXI7WHTQ5T4DVA5CNFSM4KFOBK22YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI2XDOY#issuecomment-573927867>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAF6J3UY5ISBU3E4E4BF4DQ5T4DVANCNFSM4KFOBK2Q>
.
|
I think we've got this, pretty much. I need help resolving the promise to cancel the export, though -- @sashadev-sky @VladimirMikulic do you have any tips for me here? I'll try pushing this to unstable as soon as I can for testing! |
Awesome 🎉 🎉 |
// repeatedly fetch the status.json | ||
var updateInterval = setInterval(function intervalUpdater() { | ||
// need to bust cache with a rotating timestamp... | ||
$.ajax('http://export.mapknitter.org/' + status_url + '?' + Date.now(), { // bust cache with timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: after we get the first status.json
response, update the URL to go directly to Google Cloud, so we pay less
You could wrap |
😕 -- oddly there is no But, are we able to compare to the manifest I referenced above where I did have it working locally? Or is that how you're comparing it? Thanks! |
Yes the comparison was from the manifests, where I found tags.js. If it's not familiar then it's likely it's an artifact of the build. |
I found some missing commands when comparing the Makefile that we use in Plots2 vs this one, this looks to be the issue. |
I feel I'm getting closer. I can reproduce the issue I think, that is, I seem to be unable to build assets in unstable, I get the following output instead of the expected:
|
Allright! I slowly reviewed all differences with plots2 and found |
Wow, it seems to be working!!! I think we can merge this now. There is some follow-up fixing we ought to do but it's good enough to publish... let me review the checklist first! |
Yes, the next step is to merge this, the test on stable. 🙌 I'm waiting for my export to complete but otherwise all good! OK the export worked well. But the alert didn't show. Will check this then merge. |
Ah, i had removed the completion alert. Adding it back in then this is good to merge -- @icarito if you see it pass with my new commit, feel free to! |
data = JSON.parse(data); | ||
console.log(data, data.status, data.jpg); | ||
if (data && data.status == "complete") { | ||
alert("Export completed at " + data.cm_per_pixel + " cm/px. JPG available at https://mapknitter-exports-warps.storage.googleapis.com/" + data.jpg.split('public/warps')[1] + " -- Please refresh page to view completed exports."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I set the alert to show the JPG and direct towards a reload. then cleared the interval. Wooo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok on unstable so far!
Sure, except I don't seem to have the privileges to do so... |
Hi @icarito i'm not sure the latest code is on unstable... it's not giving me an alert. Can you check to be sure the latest commits are up there? Thanks! I'm testing at: https://unstable.mapknitter.org/maps/testmap/edit |
Hi Jeff,
Indeed you seem to be pushing to the branch on your fork, instead of
/unstable/on the main repo.
It is not automatic like PRs are!
On my dev machine I pulled your branch into the `unstable` branch and
then pushed it to github, triggering redeployment (in progress now).
One quick way to push to unstable is `git push origin HEAD:unstable`
/in addition to/pushing to your branch.
Glad to be of service!
El mié, 25 de mar de 2020 a las 13:10, Jeffrey Warren
<notifications@github.com> escribió:
… Hi @icarito <https://github.com/icarito> i'm not sure the latest code
is on unstable... it's not giving me an alert. Can you check to be
sure the latest commits are up there? Thanks!
I'm testing at: <https://unstable.mapknitter.org/maps/testmap/edit>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1192 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABQYS6E2ARDQTO4AZUBP5DRJJQK5ANCNFSM4KFOBK2Q>.
|
Ah, sorry!!! it's been a while since i did it! |
Fixes #1190 and addresses #1191
This will require some manual testing!