Giter Site home page Giter Site logo

di-eco / bobc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benchkram/bobc

0.0 0.0 0.0 238 KB

Remote cache for https://bob.build

Home Page: https://bob.build/docs/remote-cache

License: GNU Affero General Public License v3.0

Go 98.62% Nix 0.56% Dockerfile 0.83%

bobc's Introduction

bobc

A Remote Cache for Bob



bobc is a lightweight, open source implementation of the bob Cloud Platform - https://bob.build. It is implemented in Go, and it uses an AWS S3-compatible storage backend for storing build artifacts, along with a Postgres database for storing projects and artifact metadata.


Getting Started

To build and run bobc locally, you must have the following tools present on your system:

Bob is used to build the Go binary and the container image. Docker-compose is used to ramp up a local environment with a Postgres database, MinIO (S3-compatible object storage) and Adminer to aid in inspecting the database contents.

First of all, clone the repository and cd into it:

git clone https://github.com/benchkram/bobc
cd bobc

You also need to clone the bob repo, since the openapi-related generated files will need to be updated once the actual build is invoked.

bob clone

Building

To build the bobc container, run the following command:

bob build container

This command will install any build dependencies (Go, Docker, GolangCI-Lint), bootstrap the project, build the bobc binary and subsequently build the container.

Running

To set up the docker-compose environment and start the server run:

export API_KEY="example-api-key"
docker compose up -d

You should now see bobc running on port 8100.

Note: MinIO at localhost requires a host alias to be set up in order to work properly. You should add the following to your /etc/hosts file:

127.0.0.1       minio

Example: Creating a project and pushing artifacts to it

You must create a project to be able to sync artifacts to the server. To do so, open a new terminal session and use the following curl command:

curl -X POST http://localhost:8100/api/projects \
   -H "Content-Type: application/json" \
   -H "Authorization: Bearer $API_KEY" \
   -d '{"name": "bobc-example"}'

This will create a project named bobc-example.

Next, you should configure an authentication context for bob. We'll use the same API_TOKEN as bearer token:

export API_KEY="example-api-key"
bob auth init --token=$API_KEY

You can verify artifact sync is working by typing

cd example
bob build --insecure --push

We have to use the --insecure flag since bobc is running over HTTP by default locally. We also pass the --push flag to instruct bob to attempt to push artifacts to the artifact store. Bob will not push artifacts upstream by default.

For more information on how to use bob with bobc, please refer to the official documentation: https://bob.build/docs/remote-cache#pushing--pulling-artifacts

bobc's People

Contributors

rdnt avatar equanox avatar

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.