Skip to content
Open
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
67 changes: 67 additions & 0 deletions .github/workflows/router-smoke-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Router Smoke Test

on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/router-smoke-test.yml'
- 'dev-scripts/directory-structure-maker/**'
- 'resources/license/**'
- 'router/**'
- 'test.sh'

concurrency:
group: router-smoke-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
smoke-test:
runs-on: ubuntu-22.04
timeout-minutes: 120

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Free disk space
run: |
df -h
sudo rm -rf /usr/local/lib/android /opt/ghc /usr/share/dotnet
docker system prune -af || true
df -h

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '11'
cache: maven

- name: Set up Go 1.18
uses: actions/setup-go@v5
with:
go-version: '1.18.10'

- name: Show tool versions
run: |
java -version
mvn -version
go version
docker version
docker compose version

- name: Run smoke test
env:
COMPOSE_PROJECT_NAME: ccsmokegha
run: ./test.sh

- name: Upload smoke test artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: smoke-test-logs
path: test-artifacts/**
if-no-files-found: ignore
11 changes: 4 additions & 7 deletions adapter/pkg/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,10 @@ func handleError(err error, message string) bool {
return false
}

/* StartPrometheusMetricsServer initializes and starts the metrics server to expose metrics to prometheus.
It employs goroutines for concurrent execution of serving metrics and recording them, while ensuring
sequential execution for each recordMetrics call using a synchronization channel (done).
Parameters:
- port: The port number to listen on.
- collectionInterval: The interval for recording metrics.
*/
// StartPrometheusMetricsServer initializes and starts the metrics server to expose
// metrics to Prometheus. It uses goroutines for serving metrics and recording
// them concurrently while ensuring each recordMetrics call completes before the
// next one starts.
func StartPrometheusMetricsServer(port int32, collectionInterval int32) {
done := make(chan struct{}) // Channel to indicate recordMetrics routine exit

Expand Down
1 change: 1 addition & 0 deletions dev-scripts/directory-structure-maker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ choreo-connect-1.1.0
│ ├── Dockerfile
│ ├── Dockerfile.ubuntu
│ ├── LICENSE.txt
│ ├── NOTICE.txt
│ └── etc
│ ├── envoy
│ │ └── envoy.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ mv ./ENFORCER/bin/grpc_health_probe ./ENFORCER/bin/grpc_healt
docker cp $ROUTER_IMAGE_ID:home/wso2/interceptor ./ROUTER/\$HOME/
docker cp $ROUTER_IMAGE_ID:home/wso2/wasm ./ROUTER/\$HOME/
cp ../temp/LICENSE.txt ./ROUTER/
if docker cp $ROUTER_IMAGE_ID:/NOTICE.txt ./ROUTER/; then
echo "Router NOTICE.txt copied"
fi
docker cp $ROUTER_IMAGE_ID:/etc/envoy/envoy.yaml ./ROUTER/etc/envoy/
docker cp $ROUTER_IMAGE_ID:/home/wso2/envoy.yaml.template ./ROUTER/\$HOME/
docker cp $ROUTER_IMAGE_ID:/home/wso2/docker-entrypoint.sh ./ROUTER/\$HOME/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ echo "Building Router image"
mkdir -p router/maven/security/truststore/
cp -r ROUTER/\$HOME/* router/maven
cp ROUTER/LICENSE.txt router/maven
if [ -f ROUTER/NOTICE.txt ]; then
cp ROUTER/NOTICE.txt router/maven
else
echo "error: ROUTER/NOTICE.txt is missing; router docker build will fail without maven/NOTICE.txt"
exit 1
fi
cp ROUTER/etc/envoy/envoy.yaml router/maven/envoy.yaml
docker build -f ROUTER/Dockerfile -t "${docker_repo}/choreo-connect-router:${docker_tag}" router

Expand Down
1 change: 1 addition & 0 deletions resources/license/LICENSE-ROUTER.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ below is and where the actual text of the license can be found.

Dependency Version License
-------------------------------------------------------------------------------------------------------------
https://github.com/envoyproxy/envoy v1.24.1 apache2
https://github.com/proxy-wasm/proxy-wasm-cpp-sdk c32d380ca6c9b1afac38a3841be99c37af2698bf apache2

The license types used by the above libraries and their information is given below:
Expand Down
4 changes: 4 additions & 0 deletions resources/license/NOTICE-ROUTER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Envoy
Copyright The Envoy Project Authors

Licensed under Apache License 2.0. See LICENSE for terms.
5 changes: 5 additions & 0 deletions router/src/main/assembly/assembly.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<outputDirectory/>
<destName>LICENSE.txt</destName>
</file>
<file>
<source>../resources/license/NOTICE-ROUTER.txt</source>
<outputDirectory/>
<destName>NOTICE.txt</destName>
</file>
<file>
<source>src/main/resources/envoy.yaml.template</source>
<outputDirectory/>
Expand Down
17 changes: 12 additions & 5 deletions router/src/main/resources/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# -----------------------------------------------------------------------
FROM envoyproxy/envoy:v1.24.1
FROM envoyproxy/envoy:v1.24.1 AS envoy-binary

FROM ubuntu:22.04
LABEL maintainer="WSO2 Docker Maintainers <wso2.com>"

RUN apt-get update && apt-get upgrade -y \
&& apt-get install --no-install-recommends --no-install-suggests -y gettext-base
&& apt-get install --no-install-recommends --no-install-suggests -y ca-certificates gettext-base \
&& apt-get autoremove -y && apt-get clean \
&& rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*

ENV LANG=C.UTF-8

Expand All @@ -34,11 +38,12 @@ ARG MOTD="\n\
which is under the Apache License, Version 2.0. \n\
Read more about Apache License, Version 2.0 here @ http://www.apache.org/licenses/LICENSE-2.0.\n"

RUN \
groupadd --system -g ${MG_USER_GROUP_ID} ${MG_USER_GROUP} \
RUN mkdir -p /etc/envoy \
&& groupadd --system -g ${MG_USER_GROUP_ID} ${MG_USER_GROUP} \
&& useradd --system --create-home --home-dir ${MG_USER_HOME} --no-log-init -g ${MG_USER_GROUP_ID} -u ${MG_USER_ID} ${MG_USER} \
&& chown -R ${MG_USER}:${MG_USER_GROUP} ${MG_USER_HOME} \
&& echo '[ ! -z "${TERM}" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc; echo "${MOTD}" > /etc/motd
&& echo '[ ! -z "${TERM}" -a -r /etc/motd ] && cat /etc/motd' >> /etc/bash.bashrc \
&& echo "${MOTD}" > /etc/motd

ENV ROUTER_ADMIN_HOST=0.0.0.0
ENV ROUTER_ADMIN_PORT=9000
Expand Down Expand Up @@ -66,7 +71,9 @@ USER ${MG_USER}
ENV ENVOY_UID=0
ENV ENVOY_GID=0

COPY --from=envoy-binary /usr/local/bin/envoy /usr/local/bin/envoy
COPY maven/LICENSE.txt .
COPY maven/NOTICE.txt .
COPY maven/wasm /home/wso2/wasm
COPY maven/interceptor /home/wso2/interceptor
COPY maven/envoy.yaml /etc/envoy/envoy.yaml
Expand Down
Loading
Loading