Giter VIP home page Giter VIP logo

portfolio's Introduction

portfolio

Portfolio is a distribution implementation focused on safe concurrent object storage management via transactional metadata and relatively simple abstractions between HTTP API and storage backends.

Development Environment

Requirements

Setup

  1. Bring up the docker compose dev env:
docker compose up -d
  1. Initialized the cockroachdb cluster:
docker exec -it portfolio-region1-1 ./cockroach init --insecure
  1. Take note of the postgres connection string in the output of docker compose logs. These should look something like the following (note that you will have to replace the network identifier with localhost later):
postgresql://root@71990c668326:26257/defaultdb?sslmode=disable
  1. Retrieve your secret & access keys for Spaces.
  2. Create a file called dev-config.yml that should look something like:
metadata:
  type: Postgres
  connection_string: postgresql://root@localhost:26257/defaultdb?sslmode=disable
objects:
  type: S3
  secret_key: <spaces-secret-key>
  access_key: <spaces-access-key>
  hostname: <bucket-region>.digitaloceanspaces.com
  bucket_name: <bucket-name>

  1. Run DB migrations:
export DATABASE_URL=postgresql://root@localhost:26257/defaultdb?sslmode=disable
cargo install sqlx-cli
sqlx migrate run --source db/postgres/migrations

Compile Time DB Query Validation

Because we use the sqlx::query! macro, which provides compile-time Postgres query correctness guarantees, you will need to set a connection string variable when compiling locally or if your text editor uses rust-analyzer (which it should!), otherwise you will see DB connection errors at compile time. For example, if running cargo build to verify your changes build then you would need the following in your shell:

export DATABASE_URL=postgresql://root@localhost:26257/defaultdb?sslmode=disable

portfolio's People

Contributors

waynr avatar collinshoop avatar bumyongchoi avatar

Watchers

James Cloos 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.