Skip to content

Commit 996692d

Browse files
authored
Merge pull request #114
Publish containers to docker.io
2 parents 96d61f7 + c2c7a87 commit 996692d

File tree

7 files changed

+104
-71
lines changed

7 files changed

+104
-71
lines changed

.github/workflows/publish.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ jobs:
1717
contents: read
1818
packages: write
1919
steps:
20-
- uses: docker/setup-qemu-action@v3
2120
- uses: docker/setup-buildx-action@v3
21+
- uses: docker/login-action@v3
22+
with:
23+
username: ${{ vars.DOCKERHUB_USERNAME }}
24+
password: ${{ secrets.DOCKERHUB_TOKEN }}
2225
- uses: docker/login-action@v3
2326
with:
2427
registry: ghcr.io
@@ -28,15 +31,18 @@ jobs:
2831
- uses: docker/metadata-action@v5
2932
id: meta
3033
with:
31-
images: ghcr.io/${{ github.repository }}
34+
images: |
35+
${{ github.repository }}
36+
ghcr.io/${{ github.repository }}
3237
tags: |
3338
type=raw,value=latest,enable={{is_default_branch}}
3439
type=semver,pattern={{version}}
3540
type=semver,pattern={{major}}.{{minor}}
3641
type=semver,pattern={{major}}
3742
- name: Build and publish
38-
uses: docker/build-push-action@v5
43+
uses: docker/build-push-action@v6
3944
with:
45+
annotations: ${{ steps.meta.outputs.annotations }}
4046
context: .
4147
file: Containerfile
4248
platforms: |

Containerfile

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,28 @@
1-
FROM debian:12-slim as builder
1+
FROM --platform=$BUILDPLATFORM debian:12-slim AS builder
2+
3+
ARG TARGETARCH
4+
5+
COPY . /tmp/source
6+
WORKDIR /tmp
27

38
RUN apt-get update \
9+
&& \
10+
ruek_march=$(./source/bin/march.sh) \
11+
&& \
12+
if [ "$ruek_march" = "x86_64" ]; then ruek_march=x86-64; fi \
413
&& \
514
apt-get install -y --no-install-recommends \
615
cmake ninja-build \
7-
clang libclang-rt-dev \
16+
binutils-${ruek_march}-linux-gnu g++ \
817
protobuf-compiler libprotobuf-dev libprotoc-dev \
918
libpq-dev
1019

11-
COPY . /tmp/source
12-
WORKDIR /tmp
13-
14-
RUN cmake -B build -G Ninja -S source/ \
15-
-DCMAKE_BUILD_TYPE=Release \
16-
-DRUEK_BUILD_TESTING=OFF
20+
RUN ruek_march=$(./source/bin/march.sh) \
21+
&& \
22+
cmake -B build -G Ninja -S source/ \
23+
-DCMAKE_CXX_COMPILER_TARGET=${ruek_march}-linux-gnu \
24+
-DCMAKE_BUILD_TYPE=Release \
25+
-DRUEK_BUILD_TESTING=OFF
1726

1827
RUN cmake --build build/ --config Release
1928

bin/march.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env sh
2+
3+
: ${ruek_march=unknown}
4+
5+
if [ -z ${TARGETARCH} ]; then
6+
TARGETARCH=$(uname -m)
7+
fi
8+
9+
case ${TARGETARCH} in
10+
amd64 | x86_64)
11+
ruek_march=x86_64
12+
;;
13+
aarch64 | arm64)
14+
ruek_march=aarch64
15+
;;
16+
esac
17+
18+
echo ${ruek_march}

src/svc/authz.h

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ class Impl {
1717
return {grpcxx::status::code_t::unimplemented, std::nullopt};
1818
}
1919

20-
template <>
21-
rpcCheck::result_type call<rpcCheck>(grpcxx::context &ctx, const rpcCheck::request_type &req);
22-
23-
template <>
24-
rpcGrant::result_type call<rpcGrant>(grpcxx::context &ctx, const rpcGrant::request_type &req);
25-
26-
template <>
27-
rpcRevoke::result_type call<rpcRevoke>(
28-
grpcxx::context &ctx, const rpcRevoke::request_type &req);
29-
3020
google::rpc::Status exception() noexcept;
3121

3222
private:
@@ -35,5 +25,15 @@ class Impl {
3525
db::Tuple map(const grpcxx::context &ctx, const rpcGrant::request_type &from) const noexcept;
3626
rpcGrant::response_type map(const db::Tuple &from) const noexcept;
3727
};
28+
29+
template <>
30+
rpcCheck::result_type Impl::call<rpcCheck>(grpcxx::context &ctx, const rpcCheck::request_type &req);
31+
32+
template <>
33+
rpcGrant::result_type Impl::call<rpcGrant>(grpcxx::context &ctx, const rpcGrant::request_type &req);
34+
35+
template <>
36+
rpcRevoke::result_type Impl::call<rpcRevoke>(
37+
grpcxx::context &ctx, const rpcRevoke::request_type &req);
3838
} // namespace authz
3939
} // namespace svc

src/svc/entities.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ class Impl {
1818
return {grpcxx::status::code_t::unimplemented, std::nullopt};
1919
}
2020

21-
template <>
22-
rpcList::result_type call<rpcList>(grpcxx::context &ctx, const rpcList::request_type &req);
23-
24-
template <>
25-
rpcListPrincipals::result_type call<rpcListPrincipals>(
26-
grpcxx::context &ctx, const rpcListPrincipals::request_type &req);
27-
2821
google::rpc::Status exception() noexcept;
2922

3023
private:
3124
template <typename T, typename F> T map(const F &) const noexcept;
25+
};
3226

33-
template <> rpcList::response_type map(const db::Tuples &from) const noexcept;
34-
template <> rpcListPrincipals::response_type map(const db::Tuples &from) const noexcept;
27+
template <>
28+
rpcList::result_type Impl::call<rpcList>(grpcxx::context &ctx, const rpcList::request_type &req);
3529

36-
template <> ruek::api::v1::EntitiesEntity map(const db::Tuple &from) const noexcept;
37-
template <> ruek::api::v1::EntitiesPrincipal map(const db::Tuple &from) const noexcept;
38-
};
30+
template <>
31+
rpcListPrincipals::result_type Impl::call<rpcListPrincipals>(
32+
grpcxx::context &ctx, const rpcListPrincipals::request_type &req);
33+
34+
template <> rpcList::response_type Impl::map(const db::Tuples &from) const noexcept;
35+
template <> rpcListPrincipals::response_type Impl::map(const db::Tuples &from) const noexcept;
36+
37+
template <> ruek::api::v1::EntitiesEntity Impl::map(const db::Tuple &from) const noexcept;
38+
template <> ruek::api::v1::EntitiesPrincipal Impl::map(const db::Tuple &from) const noexcept;
3939
} // namespace entities
4040
} // namespace svc

src/svc/principals.h

+19-19
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,6 @@ class Impl {
1818
return {grpcxx::status::code_t::unimplemented, std::nullopt};
1919
}
2020

21-
template <>
22-
rpcCreate::result_type call<rpcCreate>(
23-
grpcxx::context &ctx, const rpcCreate::request_type &req);
24-
25-
template <>
26-
rpcDelete::result_type call<rpcDelete>(
27-
grpcxx::context &ctx, const rpcDelete::request_type &req);
28-
29-
template <>
30-
rpcList::result_type call<rpcList>(grpcxx::context &ctx, const rpcList::request_type &req);
31-
32-
template <>
33-
rpcRetrieve::result_type call<rpcRetrieve>(
34-
grpcxx::context &ctx, const rpcRetrieve::request_type &req);
35-
36-
template <>
37-
rpcUpdate::result_type call<rpcUpdate>(
38-
grpcxx::context &ctx, const rpcUpdate::request_type &req);
39-
4021
google::rpc::Status exception() noexcept;
4122

4223
private:
@@ -46,5 +27,24 @@ class Impl {
4627
rpcCreate::response_type map(const db::Principal &from) const noexcept;
4728
rpcList::response_type map(const db::Principals &from) const noexcept;
4829
};
30+
31+
template <>
32+
rpcCreate::result_type Impl::call<rpcCreate>(
33+
grpcxx::context &ctx, const rpcCreate::request_type &req);
34+
35+
template <>
36+
rpcDelete::result_type Impl::call<rpcDelete>(
37+
grpcxx::context &ctx, const rpcDelete::request_type &req);
38+
39+
template <>
40+
rpcList::result_type Impl::call<rpcList>(grpcxx::context &ctx, const rpcList::request_type &req);
41+
42+
template <>
43+
rpcRetrieve::result_type Impl::call<rpcRetrieve>(
44+
grpcxx::context &ctx, const rpcRetrieve::request_type &req);
45+
46+
template <>
47+
rpcUpdate::result_type Impl::call<rpcUpdate>(
48+
grpcxx::context &ctx, const rpcUpdate::request_type &req);
4949
} // namespace principals
5050
} // namespace svc

src/svc/relations.h

+19-19
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,6 @@ class Impl {
2121
return {grpcxx::status::code_t::unimplemented, std::nullopt};
2222
}
2323

24-
template <>
25-
rpcCheck::result_type call<rpcCheck>(grpcxx::context &ctx, const rpcCheck::request_type &req);
26-
27-
template <>
28-
rpcCreate::result_type call<rpcCreate>(
29-
grpcxx::context &ctx, const rpcCreate::request_type &req);
30-
31-
template <>
32-
rpcDelete::result_type call<rpcDelete>(
33-
grpcxx::context &ctx, const rpcDelete::request_type &req);
34-
35-
template <>
36-
rpcListLeft::result_type call<rpcListLeft>(
37-
grpcxx::context &ctx, const rpcListLeft::request_type &req);
38-
39-
template <>
40-
rpcListRight::result_type call<rpcListRight>(
41-
grpcxx::context &ctx, const rpcListRight::request_type &req);
42-
4324
google::rpc::Status exception() noexcept;
4425

4526
private:
@@ -71,5 +52,24 @@ class Impl {
7152
std::string_view spaceId, db::Tuple::Entity left, std::string_view relation,
7253
db::Tuple::Entity right, std::uint16_t limit) const;
7354
};
55+
56+
template <>
57+
rpcCheck::result_type Impl::call<rpcCheck>(grpcxx::context &ctx, const rpcCheck::request_type &req);
58+
59+
template <>
60+
rpcCreate::result_type Impl::call<rpcCreate>(
61+
grpcxx::context &ctx, const rpcCreate::request_type &req);
62+
63+
template <>
64+
rpcDelete::result_type Impl::call<rpcDelete>(
65+
grpcxx::context &ctx, const rpcDelete::request_type &req);
66+
67+
template <>
68+
rpcListLeft::result_type Impl::call<rpcListLeft>(
69+
grpcxx::context &ctx, const rpcListLeft::request_type &req);
70+
71+
template <>
72+
rpcListRight::result_type Impl::call<rpcListRight>(
73+
grpcxx::context &ctx, const rpcListRight::request_type &req);
7474
} // namespace relations
7575
} // namespace svc

0 commit comments

Comments
 (0)