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

Docker support to wharf-cmd-worker #25

Open
applejag opened this issue Jan 11, 2022 · 0 comments
Open

Docker support to wharf-cmd-worker #25

applejag opened this issue Jan 11, 2022 · 0 comments
Labels
c/worker Component: wharf-cmd-worker enhancement New feature or request prio/1 Low priority. "Nice to have"
Milestone

Comments

@applejag
Copy link
Contributor

Inspired by RFC-0025: wharf-cmd provisioning

Depends on:

Requirements

  • Ability to copy repository into new temporary directory, one copy per build step.

  • Ability to generate build ID. Needs to not collide with previous build IDs via ~/.local/share/wharf/wharf-cmd/last-build-id.txt / %APPDATA%/wharf/wharf-cmd/last-build-id.txt file with simple file-based locking.

  • Ability to create a new Docker container per build step containing:

    • Volume mounting copy of repository into container
    • labels:
      • app=wharf-cmd-worker-step
      • wharf.iver.com/managed-by=wharf-cmd
      • wharf.iver.com/instance=local
      • wharf.iver.com/build-ref=123
      • wharf.iver.com/project-id=456
      • wharf.iver.com/stage-id=789
      • wharf.iver.com/step-id=789
  • Ability to list Docker containers for containers with labels:

    • wharf.iver.com/managed-by=wharf-cmd
    • wharf.iver.com/instance=local
    • wharf.iver.com/build-ref=*
  • Ability to delete Docker containers based on their ID, and error if they don't have the following labels:

    • wharf.iver.com/managed-by=wharf-cmd
    • wharf.iver.com/instance=local
    • wharf.iver.com/build-ref=*
  • All this by communicating via the Docker socket: https://docs.docker.com/engine/reference/commandline/dockerd/#bind-docker-to-another-hostport-or-a-unix-socket (and not by using the docker CLI)

    • unix:///var/run/docker.sock on Linux
    • tcp://127.0.0.1:2376 on Windows
    • or what's in the DOCKER_HOST environment variable
  • Change step types to create Docker containers with the correct image and commands.

Out of scope (don't focus on this yet)

  • Create a new Docker image with local repository to not need to duplicate repo files for each container. This is optimization that's left for later.
@applejag applejag added the c/worker Component: wharf-cmd-worker label Jan 11, 2022
@applejag applejag added this to the RFC-0025 milestone Jan 11, 2022
@applejag applejag added the enhancement New feature or request label Jan 11, 2022
@applejag applejag added the prio/1 Low priority. "Nice to have" label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/worker Component: wharf-cmd-worker enhancement New feature or request prio/1 Low priority. "Nice to have"
Projects
None yet
Development

No branches or pull requests

1 participant