Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint
on: [push, pull_request, workflow_dispatch]

jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16"
- name: download dependencies
run: make download
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
skip-go-installation: true
version: v1.41.1
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release
on:
push:
tags:
- "v*.*.*"

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-go@v2
with:
go-version: "1.16"
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2.6.1
with:
distribution: goreleaser
version: latest
args: --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test
on: [push, pull_request, workflow_dispatch]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: "1.16"
- name: run tests
run: make test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@

# Dependency directories (remove the comment below to include it)
# vendor/

dist/
coverage/
config.yaml
84 changes: 84 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
project_name: entropy

release:
prerelease: auto
draft: true

before:
hooks:
- make clean

builds:
- main: ./main.go
id: "entropy"
binary: entropy
flags: [-a]
ldflags:
- -X github.com/odpf/entropy/version.Version={{.Tag}}
- -X github.com/odpf/entropy/version.Commit={{.FullCommit}}
- -X github.com/odpf/entropy/version.BuildTime={{.Date}}
goos:
- darwin
- linux
- windows
goarch:
- amd64
- 386
- arm
- arm64
env:
- CGO_ENABLED=0

archives:
- replacements:
darwin: macos
linux: linux
windows: windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip

checksum:
name_template: 'checksums.txt'

snapshot:
name_template: "{{ .Version }}-next"

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^build:'
- '^ci:'

dockers:
- goos: linux
goarch: amd64
ids:
- entropy
dockerfile: Dockerfile
image_templates:
- 'docker.io/odpf/{{.ProjectName}}:latest'
- 'docker.io/odpf/{{.ProjectName}}:{{ .Version }}'
- 'docker.io/odpf/{{.ProjectName}}:{{ .Version }}-amd64'

brews:
- name: entropy
homepage: "https://github.com/odpf/entropy"
description: "Infrastructure orchestration tool."
tap:
owner: odpf
name: homebrew-taps
license: "Apache 2.0"
folder: Formula
dependencies:
- name: git
install: |-
bin.install "entropy"
commit_author:
name: Rohil Surana
email: rohilsurana96@gmail.com
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM alpine:3.13

COPY entropy /usr/bin/entropy

RUN apk --no-cache add ca-certificates bash
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.5 && \
wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
chmod +x /bin/grpc_health_probe

CMD ["entropy"]
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
NAME=github.com/odpf/entropy
VERSION=$(shell git describe --tags --always --first-parent 2>/dev/null)
COMMIT=$(shell git rev-parse --short HEAD)
BUILD_TIME=$(shell date)
COVERAGE_DIR=coverage
BUILD_DIR=dist
EXE=entropy

.PHONY: all build clean

all: clean test build

build:
mkdir -p ${BUILD_DIR}
CGO_ENABLED=0 go build -ldflags '-X "${NAME}/version.Version=${VERSION}" -X "${NAME}/version.Commit=${COMMIT}" -X "${NAME}/version.BuildTime=${BUILD_TIME}"' -o ${BUILD_DIR}/${EXE}

clean:
rm -rf ${COVERAGE_DIR} ${BUILD_DIR}

download:
go mod download

test:
mkdir -p ${COVERAGE_DIR}
go test ./... -coverprofile=${COVERAGE_DIR}/coverage.out

test-coverage: test
go tool cover -html=${COVERAGE_DIR}/coverage.out
86 changes: 85 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,85 @@
# entropy
# Entropy

![test workflow](https://github.com/odpf/entropy/actions/workflows/test.yml/badge.svg)
[![Go Report Card](https://goreportcard.com/badge/github.com/odpf/entropy)](https://goreportcard.com/report/github.com/odpf/entropy)
[![Version](https://img.shields.io/github/v/release/odpf/entropy?logo=semantic-release)](Version)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](LICENSE)

Entropy is an extensible infrastructure orchestration and application deployment tool. Entropy provides features required for deploying and managing complex applications like resource versioning, config schema versioning, rollbacks dry runs etc.

## Key Features

- **No Dependency:** Written in Go. It compiles into a single binary with no external dependency.
- **Extensible:** Entropy provides framework to easily write and deploy applications to your choice of cloud
- **Runtime:** Entropy can run inside VMs or containers with minimal memory footprint.

## Documentation

Explore the following resources to get started with Entropy:

- [Configuration](./docs/reference/configuration.md) to get familar with configuring Entropy.

## Installation

Install Entropy on macOS, Windows, Linux, OpenBSD, FreeBSD, and on any machine.

#### Binary (Cross-platform)

Download the appropriate version for your platform from [releases](https://github.com/odpf/entropy/releases) page. Once downloaded, the binary can be run from anywhere.
You don’t need to install it into a global location. This works well for shared hosts and other systems where you don’t have a privileged account.
Ideally, you should install it somewhere in your PATH for easy use. `/usr/local/bin` is the most probable location.

#### Homebrew

```sh
# Install entropy (requires homebrew installed)
$ brew install odpf/taps/entropy

# Upgrade entropy (requires homebrew installed)
$ brew upgrade entropy

# Check for installed entropy version
$ entropy version
```

## Usage

Entropy typically runs as a service and requires a MongoDB to store its state.

## Running locally

```sh
# Clone the repo
$ git clone https://github.com/odpf/entropy.git

# Build entropy binary file
$ make build

# Start a MongoDB instance
$ docker-compose up

# Run entropy on a recipe file
$ ./entropy serve

```

## Running tests

```sh
# Running all unit tests, excluding extractors
$ make test
```

## Contribute

Development of Entropy happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Entropy.

Read our [contributing guide](https://odpf.github.io/entropy/docs/contribute/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Entropy.

To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/odpf/entropy/labels/good%20first%20issue) that contain bugs which have a relatively limited scope. This is a great place to get started.

This project exists thanks to all the [contributors](https://github.com/odpf/entropy/graphs/contributors).

## License

Entropy is [Apache 2.0](LICENSE) licensed.
15 changes: 15 additions & 0 deletions api/handlers/v1/resource.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package handlersv1

import (
"github.com/odpf/entropy/service"
)

type APIServer struct {
container *service.Container
}

func NewApiServer(container *service.Container) *APIServer {
return &APIServer{
container: container,
}
}
Loading