Coder Social home page Coder Social logo

sbcd90 / cargo-fetcher Goto Github PK

View Code? Open in Web Editor NEW

This project forked from embarkstudios/cargo-fetcher

0.0 1.0 0.0 295 KB

๐ŸŽ cargo plugin for quickly fetching dependencies ๐Ÿฆ€

Home Page: http://embark.rs

License: Apache License 2.0

Rust 100.00%

cargo-fetcher's Introduction

๐ŸŽ cargo-fetcher

Build Status Crates.io Docs Contributor Covenant Embark

Alternative to cargo fetch for use in CI or other "clean" environments that you want to quickly bootstrap with the necessary crates to compile/test etc your project(s).

Why?

  • You run CI jobs inside of GCP and you want faster crates.io and git downloads so that your compute resources can be spent on the things that you actually care about.

Why not?

  • You don't run CI inside of GCP. Currently cargo-fetcher only supports storing crates/git snapshots inside of GCS which means they can be located closer to the compute resources your CI is running on. PRs are of course welcome for adding additional storage backends though!
  • cargo-fetcher should not be used in a typical user environment as it completely disregards various safety mechanisms that are built into cargo, such as file-based locking.
  • You project doesn't have a Cargo.lock file. cargo-fetcher only works with Cargo.lock files (due to how cargo fetch works), so library crates without checked in lock files won't be able to use cargo-fetcher.

Features

gcs

The gcs feature enables the use of Google Cloud Storage as a backend.

  • Must provide a gs:// url to the -u | --url parameter
  • Must provide GCP service account credentials either with --credentials or via the GOOGLE_APPLICATION_CREDENTIALS environment variable

Examples

This is an example from our CI for an internal project.

Dependencies

  • 424 crates.io crates: cached - 38MB, unpacked - 214MB
  • 13 crates source from 10 git repositories: db - 27MB, checked out - 38MB

Scenario

The following CI jobs are run in parallel, each in a Kubernetes Job running on GKE. The container base is roughly the same as the official rust:1.36.0-slim image.

  • Build modules for WASM
  • Build modules for native
  • Build host client for native

~ wait for all jobs to finish ~

  • Run the tests for both the WASM and native modules from the host client

Before

All 3 build jobs take around 1m2s each to do cargo fetch --target x86_64-unknown-linux-gnu

After

All 3 build jobs take 2-3s each to do cargo fetcher --include-index mirror followed by 6s to do cargo fetch --target x86_64-unknown-linux-gnu. The 6s can probably be further reduced.

Contributing

We welcome community contributions to this project.

Please read our Contributor Guide for more information on how to get started.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

cargo-fetcher's People

Contributors

jake-shadle avatar repi avatar sbcd90 avatar

Watchers

 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.