-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from storacha/feat/infra-setup
Infra Setup
- Loading branch information
Showing
24 changed files
with
427 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.github | ||
docs | ||
.goreleaser.yaml | ||
*.md | ||
LICENSE-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Go Checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
go-check: | ||
uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@v1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"skip32bit": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Go Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: ["main"] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
go-test: | ||
uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@v1.0 | ||
with: | ||
go-versions: '["this"]' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Container | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
workflow_run: | ||
workflows: [ Releaser ] | ||
types: | ||
- completed | ||
pull_request: | ||
|
||
jobs: | ||
prepare-checkout: | ||
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' | ||
name: Prepare ref | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ref: ${{ github.event_name != 'workflow_run' && github.ref || steps.releaser.outputs.version }} | ||
steps: | ||
- name: Get Ref from releaser | ||
id: releaser | ||
if: github.event_name == 'workflow_run' | ||
uses: ipdxco/unified-github-workflows/.github/actions/inspect-releaser@v1.0 | ||
with: | ||
artifacts-url: ${{ github.event.workflow_run.artifacts_url }} | ||
publish: | ||
name: Publish | ||
needs: [ prepare-checkout ] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ needs.prepare-checkout.outputs.ref }} | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Log in to the Container registry | ||
uses: docker/#-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
- name: Extract metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=semver,pattern={{raw}} | ||
type=ref,event=branch | ||
type=raw,value=${{ needs.prepare-checkout.outputs.ref }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: GoReleaser | ||
on: | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: [Releaser] | ||
types: [completed] | ||
jobs: | ||
bin-releaser: | ||
name: Release Binaries | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: "1.20.x" | ||
- name: Release Binaries | ||
uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Release Checker | ||
|
||
on: | ||
pull_request_target: | ||
paths: [ 'version.json' ] | ||
types: [ opened, synchronize, reopened, labeled, unlabeled ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release-check: | ||
uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@v1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Releaser | ||
|
||
on: | ||
push: | ||
paths: [ 'version.json' ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
releaser: | ||
uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Tag Push Checker | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
contents: read | ||
issues: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
releaser: | ||
uses: ipdxco/unified-github-workflows/.github/workflows/tagpush.yml@v1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.vscode | ||
|
||
/cmd/indexing-service | ||
/indexing-service | ||
*.car |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
builds: | ||
- main: ./cmd | ||
binary: indexing-service | ||
ldflags: | ||
# Sets the version variable in the build package to the build version prefixed with a 'v' | ||
# Sets the main.date to a static date for checksum verification. See https://goreleaser.com/customization/builds/#reproducible-builds. | ||
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.CommitDate}} -X main.builtBy=goreleaser -X github.com/storacha/indexing-service/pkg/build.version=v{{.Version}} | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
goarch: | ||
- 'amd64' | ||
- 'arm64' | ||
# Change to a static date for checksum verification. See https://goreleaser.com/customization/builds/#reproducible-builds. | ||
mod_timestamp: '{{.CommitTimestamp}}' | ||
env: | ||
- CGO_ENABLED=0 | ||
universal_binaries: | ||
- replace: true | ||
archives: | ||
- format_overrides: | ||
- goos: windows | ||
format: zip | ||
- goos: darwin | ||
format: zip | ||
name_template: >- | ||
{{ .ProjectName }}_{{ .Version }}_ | ||
{{- if eq .Os "darwin" }}mac_os | ||
{{- else }}{{ .Os }}{{ end }}_{{ .Arch }} | ||
release: | ||
mode: keep-existing | ||
changelog: | ||
skip: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM golang:1.23-bullseye as build | ||
|
||
WORKDIR /go/src/indexing-service | ||
|
||
COPY go.* . | ||
RUN go mod download | ||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 go build -o /go/bin/indexing-service ./cmd | ||
|
||
FROM gcr.io/distroless/static-debian12 | ||
COPY --from=build /go/bin/indexing-service /usr/bin/ | ||
|
||
ENTRYPOINT ["/usr/bin/indexing-service"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
The MIT License (MIT) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Indexing Services | ||
|
||
> Indexing for Storacha Network, Cached And Ready To Go | ||
## Table of Contents | ||
|
||
* [Overview](#overview) | ||
* [Installation](#installation) | ||
* [Contribute](#contribute) | ||
* [License](#license) | ||
|
||
## Overview | ||
|
||
This is a cache and query node for finding content on Storacha quickly. | ||
|
||
## Installation | ||
|
||
Download the [indexing service binary from the latest release](https://github.com/storacha/indexing-service/releases/latest) based on your system architecture, or download and install the [indexing-service](https://github.com/storacha/indexing-service) package using the Go package manager: | ||
|
||
```bash | ||
$ go install github.com/storacha/indexing-service/cmd@latest | ||
|
||
... | ||
``` | ||
|
||
## Contribute | ||
|
||
Early days PRs are welcome! | ||
|
||
## License | ||
|
||
This library is dual-licensed under Apache 2.0 and MIT terms. | ||
|
||
Copyright 2024. Storacha Network Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.