From 8cbac78b8d0e727e80f735a3bdb8067146314cdd Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Fri, 26 Jul 2024 12:28:01 +0530 Subject: [PATCH 1/2] .github/workflows/release.yml: disable workflow for forked repos Only run job "pypi-publish" when repo is ceph/ceph-nvmeof, skip for forks (because authenticaton will fail in forks). Signed-off-by: Vallari Agrawal --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a584f9cd..39faeb1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,6 +48,7 @@ env: jobs: pypi-publish: name: Upload release to PyPI + if: github.repository == 'ceph/ceph-nvmeof' runs-on: ubuntu-latest permissions: id-token: write From ffc8022a01cca858c07a01a215d085082b1266f7 Mon Sep 17 00:00:00 2001 From: Vallari Agrawal Date: Fri, 26 Jul 2024 12:35:43 +0530 Subject: [PATCH 2/2] cli: Improve server-address/port help message Mention about using "CEPH_NVMEOF_SERVER_ADDRESS" and "CEPH_NVMEOF_SERVER_PORT" env variables in help output (ceph-nvmeof --help). Also fix README instructions for using these in containers. Signed-off-by: Vallari Agrawal --- README.md | 10 +++++++--- control/cli.py | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 897e1ffb..a487db0e 100644 --- a/README.md +++ b/README.md @@ -148,12 +148,16 @@ The same configuration can also be manually run: These can also be run by setting environment variables `CEPH_NVMEOF_SERVER_ADDRESS` and `CEPH_NVMEOF_SERVER_PORT` before running nvmeof-cli commands, example: ``` -export CEPH_NVMEOF_SERVER_ADDRESS=x.x.x.x -export CEPH_NVMEOF_SERVER_PORT=5500 +cat < /etc/ceph/nvmeof-cli.env +CEPH_NVMEOF_SERVER_ADDRESS=x.x.x.x +CEPH_NVMEOF_SERVER_PORT=5500 +EOF + // using containers -docker-compose run --it subsystem add --subsystem nqn.2016-06.io.spdk:cnode1 +docker-compose run --env-file /etc/ceph/nvmeof-cli.env -it subsystem add --subsystem nqn.2016-06.io.spdk:cnode1 // using pypi package +source /etc/ceph/nvmeof-cli.env ceph-nvmeof subsystem add --subsystem nqn.2016-06.io.spdk:cnode1 ``` diff --git a/control/cli.py b/control/cli.py index 178d99e9..f6575d2a 100644 --- a/control/cli.py +++ b/control/cli.py @@ -110,13 +110,13 @@ def __init__(self): "--server-address", default=(os.getenv('CEPH_NVMEOF_SERVER_ADDRESS') or "localhost"), type=str, - help="Server address", + help="Server address (default: CEPH_NVMEOF_SERVER_ADDRESS env variable or 'localhost')", ) self.parser.add_argument( "--server-port", default=int(os.getenv('CEPH_NVMEOF_SERVER_PORT') or "5500"), type=int, - help="Server port", + help="Server port (default: CEPH_NVMEOF_SERVER_PORT env variable or '5500')", ) self.parser.add_argument( "--client-key",