Coder Social home page Coder Social logo

colisee-builder's Issues

Create base AI dockerfile

It should probably have one BUILD_ARG, specifying where to copy the zip file from the host machine.

It should

  • copy the zip from host
  • unzip the zip
  • verify a Makefile and run files exist
  • install dependencies
  • run make

Rename index.ts to app.ts

I made the realization that any fully runnable service should be named app and any library (for purposes of easy importing) should be index

Refactor into build pipeline

Pipeline description:

  • Receive build context (API)
    • Prevent upload of excessively large archives
    • Get appropriate Dockerfile for chosen language
  • Prepare build context (Preparator)
    • Convert to appropriate archive format
    • Insert chosen Dockerfile (overwrite existing one)
  • Enqueue build context (Build queue)
    • Insert new entry into database
    • Enter into distinct queue for given team_id
  • Process queues (Executor)
    • Round robin, but prefer oldest uploads (Dequeue, handled by the map of queues)
    • Limit number building
    • set resource limits on build
    • set timeout on build
  • Verify images are pushed to registry (Surveyor/Verifier)
    • Query the image registry to prove existence of image in repo
    • Update db when success verified
  • Clean up failed builds (Janitor)
    • update db on failure
    • clean up intermediate stages, occasionally

Builder responsible for updating db?

Should the builder care about updating the db?
Should it be the responsibility of the party enqueueing the build?

No db interaction:

Benefits:

  • simpler

Problems:

  • More information is needed in POST request
  • Relies on outside party to update db properly

Insert correct Dockerfile into uploaded archive

Allow someone to choose the language when uploading. Based on that value choose the correct Dockerfile to insert. If a Dockerfile exists at the top level already, then overwrite it with one the builder owns.

Implement Endpoints

  • Add dockerode dependency

GET /

  • report status of all builds

POST /

form: {
    team_id: number, // needed to tag docker image correctly and update db
    build: tar.gz archive
}
  • Return build id to request
  • enqueue incoming build request
  • build image, write archive to storage, push image to registry

GET /build/{id}

id: number

  • Return all information for build with {id}

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.