decoder-leco / poc-data-visualization

Un POC de visualisation de données: MongoDB, PostGreSQL, Jupyter notebook, Astro
0 stars 1 forks source link

DRP: backup / restore docker volumes #17

Open Jean-Baptiste-Lasselle opened 3 months ago

Jean-Baptiste-Lasselle commented 3 months ago

This task is about implementing automated operations to backup restore all the docker volumes like https://github.com/decoder-leco/poc-data-visualization/issues/16

The question is very interesting : what are the best tools to implement such standar operations ? Is terraform good at that ? does it even make sense? Actually, when i think of terraform, ther eis one thing where terraform indeed is very interesting, the fact that terrafrom keeps the state of an infrastructure.

Now, say that i terraform my VM, with the jupyterlab inside:

resource "resilient_docker_vm" "myjupyterlab" {
  # ---
  # and you just list the docker named volumes, they automatically are backedup with the configured frequency, to the condfigured minio s3
  drp {
    backup_frequency = "<here an expression to speicify the frequency of the execution of the backup>"

    docker_volumes = [
      "rlang-packages-data",
      "deno-packages-data",
      "python-packages-data",
      "conda-packages-data"
    ],

    # ---
    # and the cloud provider gives the option to backup your data OUTSIDE of their cloud: a real 123 backup, not 
    # just in their cloud with region or datacenter sites replication as we usually have...
    backup123 {
      # --- 
      # same settings as a minio client for s3 backup https://min.io/docs/minio/linux/reference/minio-mc/minio-client-settings.html
      # -> static creds: 
      #      export MC_HOST_<alias>=https://<Access Key>:<Secret Key>@<YOUR-S3-ENDPOINT>
      # -> STS creds: 
      #      export MC_HOST_<alias>=https://<Access Key>:<Secret Key>:<Session Token>@<YOUR-S3-ENDPOINT>
      minio_access_key = "<access key id secret value fetched from vault>"
      minio_secret_key = "<access secret key secret value fetched from vault>"
      minio_service_fqdn = "fqdn of your minio service"
      s3_bucket_name = "<bucket_name>"
    }
  }

}