Giter Club home page Giter Club logo

modules's Introduction

HLB module library

This repository aims to solve the same issue as the Docker Official Images but for the Dockerfile space. We want to provide high quality modules solving common workflows that you can import into your HLB program.

Goals

  1. Bootstrap the ecosystem with high quality modules
  2. Prescribe best practices for HLB

Perhaps in the future, we can work with the upstream project to produce these modules, but for now we will try our best to consume the upstream projects the way they intended.

Contributing

  1. Create a directory with the identifier you expect users to import the module as.

Example:

import docker from fs {
	image "openllb/docker.hlb"
}
  1. Create a module.hlb in the new directory. This is the entrypoint to your module. You can create more HLB modules or subdirectories to organize your implementation, but the interface end users invoke will be from module.hlb.

  2. Write doxygen-style docs for the exported functions, we currently only support @param and @return but the typical structure is:

# A high-level description of what this function does. Lines should respect the
# 80 character limit per line, and should be written in full sentences,
# complete with punctuation.
#
# Separated by a new-line, additional context to the usage of this function can
# be followed here.
#
# @param foo A description of what the function expects from `foo`.
# @return A description of what the function returns.
fs myFunction(string foo) {
	# ...
}
  1. Create a README.md in the new directory with examples of an end-user importing and using the module.

Guidelines

  • Avoid redundant naming between the module name and the function name. For example, the module docker exports the function build so users can call docker.build instead of docker.dockerBuild.
  • Be agnostic to the input the user wants to provide by plumbing fs as a function argument. For example, don't call local and instead allow the user to provide a fs input so they can decide whether it comes from their local system, from DockerHub, or from a git remote.
  • Don't write monolithic functions, try to keep each function to have one purpose. The more granular the functions, the more concurrent the graph can be executed.
  • Provide helper options for typical usage. For example, if using local with a specific includePattern is common, provide a helper function with type option::local.

modules's People

Contributors

coryb avatar hinshun avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

hinshun

modules's Issues

Write a `go` module

Add a new module that exports the following workflows for go

  • build
  • lint
  • test
  • crossCompile

Example usage:

import go from fs {
    image "openllb/go.hlb"
}

fs default() {
    # go.build returns a scratch filesystem with the compiled binary.
    go.build fs { local "."; } "./cmd/mycmd"
}

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.