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

shared-node #1361

Merged
merged 23 commits into from
Mar 17, 2020
Merged

shared-node #1361

merged 23 commits into from
Mar 17, 2020

Conversation

scottleibrand
Copy link
Contributor

Replacement for #1359 and #1352. Installs socat on all platforms so shared-node will work.

tzachi-dar and others added 16 commits February 3, 2020 09:47
Before this checkin, ns-loop created the status data, and uploaded it to nightscout (if possible).
But in case of failure, the file will get overwritten.
This means that in the case of no internet, OAPS decisions get lost.
This checkin fixes it by adding timestamps to the files.
When internet is available, the files will be uploaded according to the correct order.
Files older than a day will be deleted.

Testing:
I have prevented uploading of files for a few hours, and when it was enabled again, data was shown correctly in nightscout site.
Decreased timeout, and saw the files being deleted.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
… of uploading it.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
This saves initilaztion time.

Worked for a day, which means testing only started.
Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
…hi-dar/oref0 into tzachi-dar-tzachi-share-node-ns-status

Conflicts:
	bin/oref0-ns-loop.sh
@scottleibrand
Copy link
Contributor Author

With those fixes, this is now running successfully on one of our Edison rigs, and uploading successfully to NS. Updating wasn't very smooth, so will need to try another rig and see whether all those issues are fixed.

@scottleibrand
Copy link
Contributor Author

Looks like the test_data directory is growing unbounded and using up all the disk space on my rig:

619M ./root/test_data

@scottleibrand
Copy link
Contributor Author

@tzachi-dar should we just stop storing stuff in ~/test_data, or do we still need that? If we need it, we'll need to add some code to delete old data so it doesn't grow indefinitely.

@scottleibrand
Copy link
Contributor Author

Looks like there are also a bunch of shared_node.(random string) files filling up /tmp/

@tzachi-dar
Copy link
Contributor

As for the test data, it is only needed to make sure that we are still getting the same result.
That is one has to go to branch dev, and create the output that would have been generated by the old code. Then move to the share node branch and the script will run it with the new code, and compare results.

If needed, I can send you the script, or you can send me the data and I'll test it.

Then we can remove the code that creates the test data.
As for the temp files in /tmp. If your disk is big enough it is not a problem, but I can also add code that deletes these temp files (probably just delete it after we have read them, or write to a file based on the pid).

So, to summarize:

  1. Should I send code to stop collecting test data?
  2. Should I send code to delete the temp files?
  3. Do you want to verify the test data? How?

Tzachi

@tzachi-dar
Copy link
Contributor

By the way, as for installing the two extra files, we can probably add an update script and add there what is needed when updating.
It will run every 15 minutes, and make sure that upgrades go smoothly.
(Needed for this pr, but also for other prs).

@scottleibrand
Copy link
Contributor Author

Yeah, an upgrade script would be a good idea.

@scottleibrand
Copy link
Contributor Author

I haven’t seen any unusual dosing predBG or upload behavior with the new code. If you’ve verified it works identically on your system, I’m fine removing the test stuff.

@tzachi-dar
Copy link
Contributor

I have updated my pr:

  1. remove temp files.
  2. Stop writing to test_data
  3. Added an upgrade script that runs every 15 minutes. (please note that I call it on it's path directly otherwise it will require an update script by itself).

…hi-dar/oref0 into tzachi-dar-tzachi-share-node-ns-status

Conflicts:
	bin/oref0-ns-loop.sh
@scottleibrand
Copy link
Contributor Author

Is this tested and ready to merge?

@tzachi-dar
Copy link
Contributor

Give me 2-3 more days for final testing, and I'll get back to you.

@tzachi-dar
Copy link
Contributor

OK, did some more testing with this code, and more running on it with a live system.
Everything is OK.
Let's merge it.

@scottleibrand scottleibrand merged commit 504a478 into dev Mar 17, 2020
@scottleibrand scottleibrand deleted the tzachi-dar-tzachi-share-node-ns-status branch March 17, 2020 21:58
mountrcg added a commit to mountrcg/oref0 that referenced this pull request Feb 21, 2024
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

Successfully merging this pull request may close these issues.

2 participants