Skip to content
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

Save a JSON status file #21

Open
jywarren opened this issue Jul 9, 2019 · 9 comments
Open

Save a JSON status file #21

jywarren opened this issue Jul 9, 2019 · 9 comments

Comments

@jywarren
Copy link
Member

jywarren commented Jul 9, 2019

In the Ruby version, we output a status.json file to track status, with the following parameters:

https://github.com/publiclab/mapknitter-exporter-sinatra/blob/b065d1de02730347255d1df4c55c9368ca53ec60/app.rb#L119-L137

Perhaps we should show status in a similar way here!

if (upload) {
fs.writeFileSync(path.join(__dirname, `../../../temp/export${pid}.html`), html);
mapknitterBucket.upload(path.join(__dirname, `../../../temp/export${pid}.html`), {
gzip: true
}).then(() => {
mapknitterBucket
.file(`export${pid}.html`)
.makePublic();
fs.unlinkSync(path.join(__dirname, `../../../temp/export${pid}.html`));
});

@tech4GT
Copy link
Member

tech4GT commented Jan 10, 2020

Hi @jywarren Sorry for the absence, I was on vacation! 😃
I am starting this now! I can't seem to find the other thread where we discussed this, so just wanted to check in with you!
This file goes in the same bucket as the final export right?

@jywarren
Copy link
Member Author

jywarren commented Jan 10, 2020 via email

@tech4GT
Copy link
Member

tech4GT commented Jan 11, 2020

@jywarren I have been thinking about the sever crashing on big exports, do you think it is possible that the server does not have the disk storage to store the export before uploading? I mean once the export is done we store the export as a file and this file is then uploaded to the cloud, following which we delete the file stored locally. Is it possible that the server does not have the disk storage to store a very large file? I mean we have been focussed on RAM all this time, if the disk space turns out to be the issue it would be kinda funny! :D

@tech4GT
Copy link
Member

tech4GT commented Jan 11, 2020

Alright! I have the basic status json mechanism in place! All the fields are not yet being filled but it works for the export!
Screen Shot 2020-01-11 at 2 15 38 PM

@jywarren
Copy link
Member Author

jywarren commented Jan 11, 2020 via email

@tech4GT
Copy link
Member

tech4GT commented Jan 11, 2020

Awesome! I'll try to research a bit about the disk space issue, or worst case we write code to store the output of all the steps in the bucket and then delete them as the compositing process is completed.

@jywarren
Copy link
Member Author

jywarren commented Jan 11, 2020 via email

@tech4GT
Copy link
Member

tech4GT commented Jan 11, 2020

Hmm, there should be. I'm not really sure at this moment. Let me get back to you with a little more research!

@tech4GT
Copy link
Member

tech4GT commented Jan 11, 2020

Oh! I just noticed something! The server restart occurs in the warping phase itself. So the disk issue should not be at play here. The status json has 4 phases: starting, warping, compositing, uploading, uploaded. The export which failed is stuck at warping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants