GithubHelp home page GithubHelp logo

metal-toolbox / fleetdb Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 17.08 MB

The API service which leverages CockroachDB as a backend to inventory firmware, bios, and other hardware information required for cohesive fleet management

License: Apache License 2.0

Go 98.88% Makefile 1.08% Dockerfile 0.04%

fleetdb's Introduction

Server Service

This repository is experimental meaning that it's based on untested ideas or techniques and not yet established or finalized or involves a radically new and innovative style! This means that support is best effort (at best!) and we strongly encourage you to NOT use this in production.

The server service is a microservice within the Hollow eco-system. Server service is responsible for providing a store for physical server information. Support to storing the device components that make up the server is available. You are also able to create attributes and versioned-attributes for both servers and the server components.

Quickstart to running locally

Install cockroachdb

The cockroachdb client is required to create and drop the test database.

Follow the instructions to install the cockroachdb dependency https://www.cockroachlabs.com/docs/stable/install-cockroachdb.html

Running server service

To run the server service locally you can bring it up with docker-compose. This will run with released images from the hollow container registry.

docker-compose -f quickstart.yml up

Enable tracing

To run the server service locally with tracing enabled you just need to include the quickstart-tracing.yml file.

docker-compose -f quickstart.yml -f quickstart-tracing.yml up

Running with local changes

The quickstart.yml compose file will run server service from released images and not the local code base. If you are doing development and want to run with your local code you can use the following command.

docker-compose -f quickstart.yml -f quickstart-dev.yml up --build

NOTE: --build is required to get docker-compose to rebuild the container if you have changes. You may also include the quickstart-tracing.yml file if you wish to have tracing support.

Adding/Changing database schema

Add a new migration file under db/migrations/ with the schema change

make docker-up
make test-database
sqlboiler crdb --add-soft-deletes

Run individual integration tests

Export the DB URI required for integration tests.

export FLEETDB_CRDB_URI="host=localhost port=26257 user=root sslmode=disable dbname=fleetdb_test"

Run test.

go test -timeout 30s -tags testtools -run ^TestIntegrationServerListComponents$ github.com/metal-toolbox/fleetdb/pkg/api/v1 -v

Dump requests and responses in the client for debugging

Setting DEBUG_CLIENT to a value will cause the client to write requests and responses to stdout.

export DEBUG_CLIENT=1 /usr/local/bin/go test -timeout 10s -tags testtools -run ^TestIntegrationServerComponentFirmwareUpdate$ github.com/metal-toolbox/fleetdb/pkg/api/v1  -v

fleetdb's People

Contributors

alva8756 avatar andy-v-h avatar dependabot[bot] avatar diogomatsubara avatar doctorvin avatar goshlanguage avatar jakeschuurmans avatar jaormx avatar joelrebel avatar nicolerenee avatar renovate[bot] 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.