-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
3,767 additions
and
108 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,3 @@ | ||
target/ | ||
bindings/wasm/ | ||
bindings/grpc/target/ |
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,41 @@ | ||
name: Build and run grpc tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
branches: | ||
- main | ||
- 'epic/**' | ||
- 'support/**' | ||
paths: | ||
- '.github/workflows/build-and-test.yml' | ||
- '.github/actions/**' | ||
- '**.rs' | ||
- '**.toml' | ||
- 'bindings/grpc/**' | ||
|
||
jobs: | ||
check-for-run-condition: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should-run: ${{ !github.event.pull_request || github.event.pull_request.draft == false }} | ||
steps: | ||
- run: | | ||
# this run step does nothing, but is needed to get the job output | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | ||
with: | ||
context: . | ||
file: bindings/grpc/Dockerfile | ||
push: false | ||
labels: iotaledger/identity-grpc:latest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: gRPC publish to dockerhub | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to publish under, defaults to latest' | ||
required: false | ||
default: latest | ||
branch: | ||
description: 'Branch to run publish from' | ||
required: true | ||
dry-run: | ||
description: 'Run in dry-run mode' | ||
type: boolean | ||
required: false | ||
default: true | ||
|
||
jobs: | ||
push_to_registry: | ||
environment: release | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.inputs.branch }} | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a | ||
with: | ||
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} | ||
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 | ||
with: | ||
context: . | ||
file: bindings/grpc/Dockerfile | ||
push: ${{ !inputs.dry-run }} | ||
labels: iotaledger/identity-grpc:${{ inputs.tag }} | ||
|
||
- name: Docker Hub Description | ||
uses: peter-evans/dockerhub-description@e98e4d1628a5f3be2be7c231e50981aee98723ae | ||
with: | ||
username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} | ||
password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} | ||
repository: iotaledger/identity-grpc | ||
readme-filepath: ./bindigns/grpc/README.md | ||
short-description: ${{ github.event.repository.description }} | ||
|
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
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,43 @@ | ||
[package] | ||
name = "identity-grpc" | ||
version = "0.1.0" | ||
authors = ["IOTA Stiftung"] | ||
edition = "2021" | ||
homepage = "https://www.iota.org" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/iotaledger/identity.rs" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[lib] | ||
path = "src/lib.rs" | ||
|
||
[[bin]] | ||
name = "identity-grpc" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
anyhow = "1.0.75" | ||
futures = { version = "0.3" } | ||
identity_eddsa_verifier = { path = "../../identity_eddsa_verifier" } | ||
identity_iota = { path = "../../identity_iota", features = ["resolver", "sd-jwt", "domain-linkage", "domain-linkage-fetch", "status-list-2021"] } | ||
identity_stronghold = { path = "../../identity_stronghold", features = ["send-sync-storage"] } | ||
iota-sdk = { version = "1.1.2", features = ["stronghold"] } | ||
openssl = { version = "0.10", features = ["vendored"] } | ||
prost = "0.12" | ||
rand = "0.8.5" | ||
serde = { version = "1.0.193", features = ["derive", "alloc"] } | ||
serde_json = { version = "1.0.108", features = ["alloc"] } | ||
thiserror = "1.0.50" | ||
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] } | ||
tokio-stream = { version = "0.1.14", features = ["net"] } | ||
tonic = "0.10" | ||
tracing = { version = "0.1.40", features = ["async-await"] } | ||
tracing-subscriber = "0.3.18" | ||
url = { version = "2.5", default-features = false } | ||
|
||
[dev-dependencies] | ||
identity_storage = { path = "../../identity_storage", features = ["memstore"] } | ||
|
||
[build-dependencies] | ||
tonic-build = "0.10" |
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 @@ | ||
FROM rust:bookworm as builder | ||
|
||
# install protobuf | ||
RUN apt-get update && apt-get install -y protobuf-compiler libprotobuf-dev musl-tools | ||
|
||
COPY . /usr/src/app/ | ||
WORKDIR /usr/src/app/bindings/grpc | ||
RUN rustup target add x86_64-unknown-linux-musl | ||
RUN cargo build --target x86_64-unknown-linux-musl --release --bin identity-grpc | ||
|
||
FROM gcr.io/distroless/static-debian11 as runner | ||
|
||
# get binary | ||
COPY --from=builder /usr/src/app/bindings/grpc/target/x86_64-unknown-linux-musl/release/identity-grpc / | ||
|
||
# set run env | ||
EXPOSE 50051 | ||
|
||
# run it | ||
CMD ["/identity-grpc"] |
Oops, something went wrong.