Garden-AI / garden

https://garden-ai.readthedocs.io
MIT License
16 stars 4 forks source link

GitHubConnector.stage() is not idempotent #413

Closed WillEngler closed 5 months ago

WillEngler commented 5 months ago

How to reproduce:

  1. Make a GitHubConnector with some GitHub repo.
  2. Run .stage() twice.

You will get

GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git clone -v --branch=main -- https://github.com/Garden-AI/garden.git gh_model
  stderr: 'fatal: destination path 'gh_model' already exists and is not an empty directory.

This is a problem - we need the .stage operation to be idempotent. We expect .stage() to be called many times in the lifetime of an entrypoint container deployed on an endpoint. It needs to be able to run multiple times.

Assumptions:

1.

Acceptance Criteria

Given I am a publisher, when I am writing an entrypoint, then I don't have to worry about checking whether my model files already exist before calling .stage()