Skip to content

Commit 52b3a61

Browse files
committed
Merge branch 'master' of github.com:permitio/opal
2 parents 88c99a4 + 3ac430e commit 52b3a61

File tree

39 files changed

+993
-1219
lines changed

39 files changed

+993
-1219
lines changed

.github/workflows/on_release.yml

Lines changed: 88 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
fetch-depth: 0
3636

3737
- name: Set up QEMU
38-
uses: docker/setup-qemu-action@v2
38+
uses: docker/setup-qemu-action@v3
3939

4040
- name: Set up Docker Buildx
41-
uses: docker/setup-buildx-action@v2
41+
uses: docker/setup-buildx-action@v3
4242

4343
- name: Login to DockerHub
4444
uses: docker/login-action@v2
@@ -57,7 +57,7 @@ jobs:
5757
5858
- name: Build client for testing
5959
id: build_client
60-
uses: docker/build-push-action@v4
60+
uses: docker/build-push-action@v6
6161
with:
6262
file: docker/Dockerfile
6363
push: false
@@ -70,7 +70,7 @@ jobs:
7070
7171
- name: Build server for testing
7272
id: build_server
73-
uses: docker/build-push-action@v4
73+
uses: docker/build-push-action@v6
7474
with:
7575
file: docker/Dockerfile
7676
push: false
@@ -101,8 +101,9 @@ jobs:
101101
# pushes the *same* docker images that were previously tested as part of e2e sanity test.
102102
# each image is pushed with the versioned tag first, if it succeeds the image is pushed with the latest tag as well.
103103
- name: Build & Push client
104-
id: build_push_client
105-
uses: docker/build-push-action@v4
104+
if: ${{ github.event.release.prerelease == false }}
105+
id: build_push_client_regular
106+
uses: docker/build-push-action@v6
106107
with:
107108
file: docker/Dockerfile
108109
platforms: linux/amd64,linux/arm64
@@ -114,9 +115,25 @@ jobs:
114115
permitio/opal-client:latest
115116
permitio/opal-client:${{ github.event.release.tag_name }}
116117
118+
- name: Build & Push client (prerelease)
119+
if: ${{ github.event.release.prerelease == true }}
120+
id: build_push_client_prerelease
121+
uses: docker/build-push-action@v6
122+
with:
123+
file: docker/Dockerfile
124+
platforms: linux/amd64,linux/arm64
125+
push: true
126+
target: client
127+
cache-from: type=registry,ref=permitio/opal-client:latest
128+
cache-to: type=inline
129+
tags: |
130+
permitio/opal-client:${{ github.event.release.tag_name }}
131+
132+
117133
- name: Build client-standalone
118-
id: build_push_client_standalone
119-
uses: docker/build-push-action@v4
134+
if: ${{ github.event.release.prerelease == false }}
135+
id: build_push_client_standalone_regular
136+
uses: docker/build-push-action@v6
120137
with:
121138
file: docker/Dockerfile
122139
platforms: linux/amd64,linux/arm64
@@ -128,9 +145,24 @@ jobs:
128145
permitio/opal-client-standalone:latest
129146
permitio/opal-client-standalone:${{ github.event.release.tag_name }}
130147
148+
- name: Build client-standalone (prerelease)
149+
if: ${{ github.event.release.prerelease == true }}
150+
id: build_push_client_standalone_prerelease
151+
uses: docker/build-push-action@v6
152+
with:
153+
file: docker/Dockerfile
154+
platforms: linux/amd64,linux/arm64
155+
push: true
156+
target: client-standalone
157+
cache-from: type=registry,ref=permitio/opal-client-standalone:latest
158+
cache-to: type=inline
159+
tags: |
160+
permitio/opal-client-standalone:${{ github.event.release.tag_name }}
161+
131162
- name: Build server
132-
id: build_push_server
133-
uses: docker/build-push-action@v4
163+
if: ${{ github.event.release.prerelease == false }}
164+
id: build_push_server_regular
165+
uses: docker/build-push-action@v6
134166
with:
135167
file: docker/Dockerfile
136168
platforms: linux/amd64,linux/arm64
@@ -142,9 +174,24 @@ jobs:
142174
permitio/opal-server:latest
143175
permitio/opal-server:${{ github.event.release.tag_name }}
144176
177+
- name: Build server (prerelease)
178+
if: ${{ github.event.release.prerelease == true }}
179+
id: build_push_server_prerelease
180+
uses: docker/build-push-action@v6
181+
with:
182+
file: docker/Dockerfile
183+
platforms: linux/amd64,linux/arm64
184+
push: true
185+
target: server
186+
cache-from: type=registry,ref=permitio/opal-server:latest
187+
cache-to: type=inline
188+
tags: |
189+
permitio/opal-server:${{ github.event.release.tag_name }}
190+
145191
- name: Build & Push client cedar
146-
id: build_push_client_cedar
147-
uses: docker/build-push-action@v4
192+
if: ${{ github.event.release.prerelease == false }}
193+
id: build_push_client_cedar_regular
194+
uses: docker/build-push-action@v6
148195
with:
149196
file: docker/Dockerfile
150197
platforms: linux/amd64,linux/arm64
@@ -156,6 +203,20 @@ jobs:
156203
permitio/opal-client-cedar:latest
157204
permitio/opal-client-cedar:${{ github.event.release.tag_name }}
158205
206+
- name: Build & Push client cedar (prerelease)
207+
if: ${{ github.event.release.prerelease == true }}
208+
id: build_push_client_cedar_prerelease
209+
uses: docker/build-push-action@v6
210+
with:
211+
file: docker/Dockerfile
212+
platforms: linux/amd64,linux/arm64
213+
push: true
214+
target: client-cedar
215+
cache-from: type=registry,ref=permitio/opal-client-cedar:latest
216+
cache-to: type=inline
217+
tags: |
218+
permitio/opal-client-cedar:${{ github.event.release.tag_name }}
219+
159220
- name: Python setup
160221
uses: actions/setup-python@v5
161222
with:
@@ -164,10 +225,22 @@ jobs:
164225
# This is the root file representing the package for all the sub-packages.
165226
- name: Bump version - packaging__.py
166227
run: |
228+
# Install required packages
229+
pip install semver packaging
230+
231+
# Get version tag and remove 'v' prefix
167232
version_tag=${{ github.event.release.tag_name }}
168-
version_tag=${version_tag#v} # Remove the leading 'v'
169-
version_tuple=$(echo $version_tag | sed 's/\./, /g')
170-
sed -i "s/VERSION = (.*/VERSION = (${version_tuple})/" packages/__packaging__.py
233+
version_tag=${version_tag#v}
234+
235+
# Convert semver to PyPI version using the script
236+
pypi_version=$(python semver2pypi.py $version_tag)
237+
238+
# Update only the __version__ in __packaging__.py
239+
sed -i "s/__version__ = VERSION_STRING/__version__ = \"$pypi_version\"/" packages/__packaging__.py
240+
241+
# Print the result for verification
242+
echo "Original version tag: $version_tag"
243+
echo "PyPI version: $pypi_version"
171244
cat packages/__packaging__.py
172245
173246
- name: Cleanup setup.py and Build every sub-packages

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,11 @@ docker-build-next:
6565
@docker build -t permitio/opal-client:next --target client -f docker/Dockerfile .
6666
@docker build -t permitio/opal-server:next --target server -f docker/Dockerfile .
6767

68+
docker-build-latest:
69+
@docker build -t permitio/opal-client-standalone:latest --target client-standalone -f docker/Dockerfile .
70+
@docker build -t permitio/opal-client:latest --target client -f docker/Dockerfile .
71+
@docker build -t permitio/opal-server:latest --target server -f docker/Dockerfile .
72+
6873
docker-run-server:
6974
@if [[ -z "$(OPAL_POLICY_REPO_SSH_KEY)" ]]; then \
7075
docker run -it \

docker/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ WORKDIR /opal
9696

9797
# copy opa from official docker image
9898
ARG opa_image=openpolicyagent/opa
99-
ARG opa_tag=latest-static
99+
ARG opa_tag=0.70.0-static
100100
RUN skopeo copy "docker://${opa_image}:${opa_tag}" docker-archive:./image.tar && \
101101
mkdir image && tar xf image.tar -C ./image && cat image/*.tar | tar xf - -C ./image -i && \
102102
find image/ -name "opa*" -type f -executable -print0 | xargs -0 -I "{}" cp {} ./opa && chmod 755 ./opa && \
@@ -126,13 +126,18 @@ USER opal
126126
# CEDAR CLIENT IMAGE --------------------------------
127127
# Using standalone image as base --------------------
128128
# ---------------------------------------------------
129+
# Extract the Cedar Agent binary from the existing image
130+
# CEDAR AGENT DOWNLOAD STAGE -----------------------
131+
# Stage to locate and extract the cedar-agent binary
132+
FROM permitio/cedar-agent:0.2.0 AS cedar-extractor
133+
129134
FROM client-standalone AS client-cedar
130135

131136
# Temporarily move back to root for additional setup
132137
USER root
133138

134-
# Copy cedar from its build stage
135-
COPY --from=cedar-builder /tmp/cedar-agent/target/*/cedar-agent /bin/cedar-agent
139+
COPY --from=cedar-extractor /agent/cedar-agent /bin/cedar-agent
140+
RUN chmod +x /bin/cedar-agent
136141

137142
# enable inline Cedar agent
138143
ENV OPAL_POLICY_STORE_TYPE=CEDAR

docker/docker-compose-with-prometheus-and-otel.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

docker/docker_files/otel-collector-config.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

docker/docker_files/prometheus.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

documentation/docs/getting-started/configuration.mdx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Please use this table as a reference.
2525
| LOG_FILE_COMPRESSION | | |
2626
| LOG_FILE_SERIALIZE | Serialize log messages in file into json format (useful for log aggregation platforms) | |
2727
| LOG_FILE_LEVEL |
28-
| LOG_DIAGNOSE | Include diagnosis in log messages | |
28+
| LOG_DIAGNOSE | Include diagnosis in log messages | |
2929
| STATISTICS_ENABLED | Collect statistics about OPAL clients. | |
3030
| STATISTICS_ADD_CLIENT_CHANNEL | The topic to update about the new OPAL clients connection. | |
3131
| STATISTICS_REMOVE_CLIENT_CHANNEL | The topic to update about the OPAL clients disconnection. | |
@@ -40,11 +40,7 @@ Please use this table as a reference.
4040
| AUTH_PUBLIC_KEY | | |
4141
| AUTH_JWT_ALGORITHM | JWT algorithm. See possible values [here](https://pyjwt.readthedocs.io/en/stable/algorithms.html). | |
4242
| AUTH_JWT_AUDIENCE | | |
43-
| AUTH_JWT_ISSUER | | |
44-
| ENABLE_OPENTELEMETRY_TRACING | Set if OPAL should enable tracing with OpenTelemetry | |
45-
| ENABLE_OPENTELEMETRY_METRICS | Set if OPAL should enable metrics with OpenTelemetry | |
46-
| ENABLE_OPENTELEMETRY_TRACING | The OpenTelemetry OTLP endpoint to send traces to, set only if ENABLE_OPENTELEMETRY_TRACING is enabled | |
47-
43+
| AUTH_JWT_ISSUER | | |
4844

4945
## OPAL Server Configuration Variables
5046

0 commit comments

Comments
 (0)