Skip to content

Commit

Permalink
chore(deps): update anchore/sbom-action action to v0.16.0 (#287)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored and laoshanxi committed May 23, 2024
1 parent b0ddabc commit d1f08c2
Show file tree
Hide file tree
Showing 17 changed files with 146 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-github-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Download Syft
id: syft
uses: anchore/sbom-action/download-syft@v0.15.11
uses: anchore/sbom-action/download-syft@v0.16.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
contents: read

steps:
- uses: actions/checkout@v4
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
Expand All @@ -32,51 +33,95 @@ jobs:
uses: addnab/docker-run-action@v3
with:
image: centos:7
options: -v ${{ github.workspace }}:/work
shell: bash
run: |
yum install -y https://github.com/laoshanxi/app-mesh/releases/download/${{ env.APPMESH_VERSION }}/appmesh_2.1.2_gcc_4.8.5_glibc_2.17_x86_64.rpm
# start appmesh
/opt/appmesh/script/appmesh-entrypoint.sh &
sleep 5
appc ls
# test appmesh golang sdk
(cd src/sdk/go && go test -v)
# test appmesh python sdk
yum install -y python3 python3-pip
python3 -m pip install --upgrade appmesh pyotp
(cd /work/test/python && python3 -m unittest)
- name: test ubuntu:18
uses: addnab/docker-run-action@v3
with:
image: ubuntu:18.04
options: -v ${{ github.workspace }}:/work
shell: bash
run: |
apt update
apt install -y wget iputils-ping
wget --quiet --no-check-certificate https://github.com/laoshanxi/app-mesh/releases/download/${{ env.APPMESH_VERSION }}/appmesh_2.1.2_gcc_7_glibc_2.27_x86_64.deb
apt install -y ./appmesh_*.deb
# start appmesh
/opt/appmesh/script/appmesh-entrypoint.sh &
sleep 5
appc ls
# test appmesh golang sdk
(cd /work/src/sdk/go && go test -v)
# test appmesh python sdk
apt install -y python3 python3-pip
python3 -m pip install --upgrade appmesh pyotp
(cd /work/test/python && python3 -m unittest)
- name: test ubuntu:22
uses: addnab/docker-run-action@v3
with:
image: ubuntu:22.04
options: -v ${{ github.workspace }}:/work
shell: bash
run: |
apt update
apt install -y wget iputils-ping
wget --quiet --no-check-certificate https://github.com/laoshanxi/app-mesh/releases/download/${{ env.APPMESH_VERSION }}/appmesh_2.1.2_gcc_11_glibc_2.35_x86_64.deb
apt install -y ./appmesh_*.deb
# start appmesh
/opt/appmesh/script/appmesh-entrypoint.sh &
sleep 5
appc ls
# test appmesh golang sdk
(cd /work/src/sdk/go && go test -v)
# test appmesh python sdk
apt install -y python3 python3-pip
python3 -m pip install --upgrade appmesh pyotp
(cd /work/test/python && python3 -m unittest)
- name: test ubuntu:24
uses: addnab/docker-run-action@v3
with:
image: ubuntu:24.04
options: -v ${{ github.workspace }}:/work
shell: bash
run: |
apt update
apt install -y wget iputils-ping
wget --quiet --no-check-certificate https://github.com/laoshanxi/app-mesh/releases/download/${{ env.APPMESH_VERSION }}/appmesh_2.1.2_gcc_13_glibc_2.39_x86_64.deb
apt install -y ./appmesh_*.deb
# start appmesh
/opt/appmesh/script/appmesh-entrypoint.sh &
sleep 5
appc ls
# test appmesh golang sdk
(cd /work/src/sdk/go && go test -v)
# test appmesh python sdk
apt install -y python3 python3-pip
python3 -m pip install --break-system-packages --upgrade appmesh pyotp
(cd /work/test/python && python3 -m unittest)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ENTRYPOINT ["tini", "--", "/appmesh-entrypoint.sh"]
##################################################################################
# docker container, accept parameters as bellow format:
# 1. Run docker container and register a long running application
# docker run -d laoshanxi/appmesh ping www.baidu.com
# docker run -d laoshanxi/appmesh ping github.com
# 2. Run docker container and excute an external cmd
# docker run -d laoshanxi/appmesh appc ls
##################################################################################
Expand Down
8 changes: 4 additions & 4 deletions docs/source/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ ID NAME OWNER STATUS HEALTH PID MEMORY %CPU RETURN LAST_START_TIM
1 qqmail admin enabled 0 - - - 0 2021-03-26 10:54:26+08 sh /opt/qqmail/launch.sh
2 ssd admin enabled 1 - - - - - /usr/sbin/fstrim -a -v
3 loki admin enabled 0 4789 3.1 Mi 0 2 2021-03-26 08:03:37+08 ping www.sina.com
4 ping admin enabled 0 4790 3.1 Mi 0 2 2021-03-26 08:03:37+08 ping www.baidu.com
4 ping admin enabled 0 4790 3.1 Mi 0 2 2021-03-26 08:03:37+08 ping github.com
5 docker enabled 0 2866 2.5 Mi 0 - 2021-03-26 08:03:28+08 ping www.sina.com
```

- View application output

```text
$ appc add -n ping -c 'ping www.baidu.com'
$ appc add -n ping -c 'ping github.com'
{
"command": "ping www.baidu.com",
"command": "ping github.com",
"name": "ping",
"owner": "admin",
"register_time": "2020-10-24 07:31:40+08",
Expand All @@ -72,7 +72,7 @@ $ appc add -n ping -c 'ping www.baidu.com'
$ appc view -n ping
{
"command": "ping www.baidu.com",
"command": "ping github.com",
"cpu": 0,
"fd": 5,
"health": 0,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/success/python_parallel_run.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ start_time = datetime.now()
runs = []
for i in range(100):
# example: 100 run shell command:
runs.append(client.run_async(appmesh_client.App({"command": "ping www.baidu.com -w {0}".format(i), "shell": True}), max_time_seconds=8))
runs.append(client.run_async(appmesh_client.App({"command": "ping github.com -w {0}".format(i), "shell": True}), max_time_seconds=8))
# example: 100 run python code segment:
runs.append(client.run_async(appmesh_client.App({"name": "pyrun", "metadata": "import time;print({0});time.sleep({0})".format(i)}), max_time_seconds=10))

Expand Down
6 changes: 3 additions & 3 deletions docs/source/success/remote_run_cli_and_python.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ root
Run a command with normal exit:

```shell
# appc run -c 'ping www.baidu.com -w 2' -t 5; echo $?
# appc run -c 'ping github.com -w 2' -t 5; echo $?
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=55 time=31.8 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=55 time=31.9 ms
Expand All @@ -26,15 +26,15 @@ rtt min/avg/max/mdev = 31.844/31.850/31.857/0.006 ms
Run a command and exit due to timeout:

```shell
# appc run -c 'ping www.baidu.com -w 2' -t 5
# appc run -c 'ping github.com -w 2' -t 5
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=55 time=31.9 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=55 time=31.7 ms

--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 31.722/31.827/31.933/0.105 ms
(base) root@appmesh:~# appc run -c 'ping www.baidu.com -w 20' -t 5; echo $?
(base) root@appmesh:~# appc run -c 'ping github.com -w 20' -t 5; echo $?
PING www.a.shifen.com (14.215.177.39) 56(84) bytes of data.
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=1 ttl=55 time=31.8 ms
64 bytes from 14.215.177.39 (14.215.177.39): icmp_seq=2 ttl=55 time=31.8 ms
Expand Down
20 changes: 7 additions & 13 deletions script/appmesh-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
################################################################################

export PROG_HOME=/opt/appmesh
export PROG=bin/appsvc
export PROGC=bin/appc
export PROG=${PROG_HOME}/bin/appsvc
export LD_LIBRARY_PATH=${PROG_HOME}/lib64:${LD_LIBRARY_PATH}

log() {
local timestamp
Expand All @@ -21,9 +21,6 @@ cd "${PROG_HOME}" || {
exit 1
}

SCRIPT_PID="$$"
export LD_LIBRARY_PATH=${PROG_HOME}/lib64:${LD_LIBRARY_PATH}

pre_start_app() {
if [[ $# -gt 0 ]]; then
if [ "$1" = "appc" ]; then
Expand All @@ -46,12 +43,9 @@ EOF
pre_start_app "$@"

while true; do
PID=$(tr -d '\0' </var/run/appmesh.pid)
PID_EXIST=$(ps aux | awk '{print $2}' | grep -w "$PID")
CMD_EXIST=$(ps aux | awk '{print $11}' | grep -w "${PROG_HOME}/${PROG}")
if [[ ! $PID_EXIST ]] && [[ ! $CMD_EXIST ]]; then
nohup "${PROG_HOME}/${PROG}" &
log "Starting App Mesh service"
fi
sleep 1
log "Starting App Mesh service: $PROG"
$PROG >/dev/null 2>&1
EXIT_STATUS=$?
log "App Mesh exit status: $EXIT_STATUS"
sleep 2
done
Loading

0 comments on commit d1f08c2

Please sign in to comment.