Code Monkey home page Code Monkey logo

Comments (7)

FranzEricSchneider avatar FranzEricSchneider commented on June 14, 2024

I found this resource about zipping a database and tried that: https://dev.to/lucis/setting-up-a-mongodb-backup-on-google-drive-3bbe

mongodump -d DB_NAME --archive=DB_save_8-5-2022.gz --gzip

Then tried using mongorestore on another computer:

mongorestore --gzip --archive=DB_save_8-5-2022.gz

When I run mongosh I can see the restored database, I think:

test> show dbs
admin    40.00 KiB
config  108.00 KiB
local    72.00 KiB
DB_NAME  10.64 GiB
sacred   40.00 KiB

However, when I try to view the database in omniboard like I used to it is unfortunately entirely blank.

omniboard localhost:27017:DB_NAME
(node:28895) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
Omniboard is listening on port 9000!
Connection to sacred at mongodb://localhost:27017 established successfully!

Screenshot from 2022-08-06 14-30-41

Any tips welcome, I'm also still unclear how one would go merging experiments run on different computers.

from sacred.

FranzEricSchneider avatar FranzEricSchneider commented on June 14, 2024

I had a dumb typo,

omniboard localhost:27017:DB_NAME

Should instead have been

omniboard  -m   localhost:27017:DB_NAME

So the process above worked for zipping a database, restoring it on another computer, and reconnecting to it. If anyone has thoughts on combining experiment results from Computer A and B as mentioned in the original question that would still be valuable!

from sacred.

thequilo avatar thequilo commented on June 14, 2024

Hi @FranzEricSchneider, great that you found a solution! Other than that, you could use the FileStorageObserver, which stores the logs in JSON files that can easily be copied between machines. It doesn't support omniboard or other related tools, though.

from sacred.

FranzEricSchneider avatar FranzEricSchneider commented on June 14, 2024

Hi @thequilo , do you know if it is possible to convert the data stored from a Mongo observer into this file storage form? That might be one way to combine experiments from multiple computers, which I'm still struggling with.

from sacred.

thequilo avatar thequilo commented on June 14, 2024

There is currently no easy way to do this. You can loop through the data stored in your mongo db manually and pass them to a file storage observer, similar to #815 but the other way around.

from sacred.

FranzEricSchneider avatar FranzEricSchneider commented on June 14, 2024

Alright, I will close this issue. If anyone does come up with a way to combine sacred runs from multiple computers I would be very interested, even in my first usage of sacred it's been necessary to run tests on multiple computers because the tests take a long time to run. My only thought at the moment is to go through the existing database on one of the computers and alter all the ids to be something like (13 -> 1013, 24 -> 1024) to prevent ID clashes, then do the database zip/unzip mentioned above.

from sacred.

FranzEricSchneider avatar FranzEricSchneider commented on June 14, 2024

Okay, in order to zip sacred tests from multiple computers I needed to make sure none of the IDs overlapped. In order to deal with overlaps I went to computer B and changed the IDs in the mongo database like so:

$ mongosh
> # Use the relevant db name
> use mmseg
> # Repeat for all necessary IDs
> runX=db.runs.findOne({_id:X});
> runX._id=100X;
> db.runs.insertOne(runX);
> db.runs.deleteOne({_id:X});
> db.metrics.updateMany({run_id:X}, {$set:{"run_id":100X}});

Then I zipped the database on computer B, moved it to computer A, restored the database, and was left with all of the results on computer A.

from sacred.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.