Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osgi service check in cosbench-start.sh not working #1

Closed
dblacknc opened this issue Dec 17, 2021 · 5 comments
Closed

osgi service check in cosbench-start.sh not working #1

dblacknc opened this issue Dec 17, 2021 · 5 comments
Assignees
Labels
question Further information is requested

Comments

@dblacknc
Copy link

dblacknc commented Dec 17, 2021

OS is Ubuntu 20.10, with netcat-openbsd 1.217-2ubuntu1. cosbench-ehualu 0.4.7.5 from the .tar.gz binaries in the tree.

The loop in cosbench-start.sh that checks for module active fails because the osgi service listener seems to need a leading CR to accept the ss command. There's also some cruft in the boot log displayed at the end, so I filtered that a bit. Proposed patch:

83c83
<                 echo -e "ss -s ACTIVE cosbench\ndisconnect\n" | $TOOL $TOOL_PARAMS 0.0.0.0 $OSGI_CONSOLE_PORT | grep $module >> /dev/null
---
>                 echo -e "\nss -s ACTIVE cosbench\ndisconnect\n" | $TOOL $TOOL_PARAMS 0.0.0.0 $OSGI_CONSOLE_PORT | grep $module >> /dev/null
114c114
< cat $BOOT_LOG
---
> cat $BOOT_LOG | fgrep -v '<>'

@kisscelia
Copy link
Collaborator

Hi, @dblacknc
Any errors when booting drivers and controller?

I try to start cosbench drivers on Centos 7.9, It's OK.
image

I will try it on Ubuntu later, thanks.

@dblacknc
Copy link
Author

dblacknc commented Dec 22, 2021

Yes, it does work normally on CentOS. This error is specific to Ubuntu - and I believe it's related to the build of netcat Ubuntu uses. This is a known issue in COSbench. Different people have found different workarounds. After experimentation I found it to be most simply fixed with the extra \n before the "ss" command, and that also shouldn't break CentOS.

@kisscelia
Copy link
Collaborator

OK, I will try it on Ubuntu & Centos, and will close this issue if both ok.

@kisscelia
Copy link
Collaborator

20.10 is not a LTS version.

I will try it in LTS version(22.04)

change nc to telnet.

@kisscelia
Copy link
Collaborator

kisscelia commented Oct 17, 2022

test version: 0.4.7.9
result: passed

dockerfile:
image

docker-compose:

version: '3.9'

services:
  driver1:
    image: "sineio/cosbench-sineio:0.4.7.9-ubuntu"
    environment:
      CONTROLLER: false
      DRIVER: true
      DRIVER_PORT: 18088
      COSBENCH_PLUGINS: "SIO,S3"
    volumes:
      - /data/cosbench/driver1-log/:/cosbench/log
      - /etc/resolv.conf:/etc/resolv.conf:ro
      - /etc/hosts:/etc/hosts:ro
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:18088/driver"]
      interval: 30s
      timeout: 20s
      retries: 3
    restart: unless-stopped
    tty: true
    stdin_open: true
    network_mode: "host"

  driver2:
    image: "sineio/cosbench-sineio:0.4.7.9-ubuntu"
    environment:
      CONTROLLER: false
      DRIVER: true
      DRIVER_PORT: 18188
      COSBENCH_PLUGINS: "SIO,S3"
    volumes:
      - /data/cosbench/driver2-log/:/cosbench/log
      - /etc/resolv.conf:/etc/resolv.conf:ro
      - /etc/hosts:/etc/hosts:ro
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:18188/driver"]
      interval: 30s
      timeout: 20s
      retries: 3
    restart: unless-stopped
    tty: true
    stdin_open: true
    network_mode: "host"

  driver3:
    image: "sineio/cosbench-sineio:0.4.7.9-ubuntu"
    environment:
      CONTROLLER: false
      DRIVER: true
      DRIVER_PORT: 18288
      COSBENCH_PLUGINS: "SIO,S3"
    volumes:
      - /data/cosbench/driver3-log/:/cosbench/log
      - /etc/resolv.conf:/etc/resolv.conf:ro
      - /etc/hosts:/etc/hosts:ro
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:18288/driver"]
      interval: 30s
      timeout: 20s
      retries: 3
    restart: unless-stopped
    tty: true
    stdin_open: true
    network_mode: "host"

  controller:
    image: "sineio/cosbench-sineio:0.4.7.9-ubuntu"
    environment:
      CONTROLLER: true
      DRIVER: false
      DRIVERS: "http://127.0.0.1:18088/driver,http://127.0.0.1:18188/driver,http://127.0.0.1:18288/driver,"
    depends_on:
      driver1:
        condition: service_healthy
      driver2:
        condition: service_healthy
      driver3:
        condition: service_healthy
    volumes:
      - /data/cosbench/archive/:/cosbench/archive
      - /data/cosbench/controller-log/:/cosbench/log
      - /etc/resolv.conf:/etc/resolv.conf
      - /etc/hosts:/etc/hosts
      - /etc/localtime:/etc/localtime:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1:19088/controller/index.html"]
      interval: 60s
      timeout: 20s
      retries: 3
    restart: unless-stopped
    tty: true
    stdin_open: true
    network_mode: "host"

start log:
image

@kisscelia kisscelia added the question Further information is requested label Aug 31, 2023
@kisscelia kisscelia self-assigned this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants