Skip to content
Closed
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
31 changes: 11 additions & 20 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,29 @@ jobs:
python-version: ["3.8", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install poetry
run: pip install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
cache: "poetry"
cache-dependency-path: "pyproject.toml"

- name: Setup java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install python2

pip install -U pip setuptools

pip install .

if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
poetry install --with=test

- name: Cache binary versions
id: cache-versions
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.ccm/repository
Expand All @@ -63,6 +52,7 @@ jobs:
- name: Download versions
if: steps.cache-versions.outputs.cache-hit != 'true'
run: |
source $(poetry env info --path)/bin/activate
normalized=$(echo ${{ inputs.reloc_version }} | tr ':' '_')
if [ ! -f ~/.ccm/scylla-repository/unstable/master/$normalized ]; then
./ccm create temp -n 1 --scylla --version unstable/master:${{ inputs.reloc_version }}
Expand All @@ -73,6 +63,7 @@ jobs:

- name: Test with pytest
run: |
source $(poetry env info --path)/bin/activate
python -m pytest ./tests -x

- name: Copy logs/results
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v20
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Cache binary versions
id: cache-versions
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
~/.ccm/repository
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ tests/test_results
.direnv/

.envrc
ccmlib/tests/
ccmlib/tests/

poetry.lock
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ Requirements
------------

- A working python installation (tested to work with python 3.12).
- `pip install -e .` to install the required dependencies.
- [Poetry](https://python-poetry.org/docs/)
- `poetry install` to install the required dependencies.
- This will create virtualenv, you can use `poetry shell` to enter it, see [poetry](https://python-poetry.org/docs/basic-usage/#using-your-virtual-environment) documentation for more details
- Java if cassandra is used or older scylla < 6.0 (which version depends on the version
of Cassandra you plan to use. If unsure, use Java 8 as it is known to
work with current versions of Cassandra).
Expand All @@ -82,7 +84,8 @@ Installation

ccm uses python setuptools (with distutils fallback) so from the source directory run:

sudo ./setup.py install
poetry install
poetry shell

ccm is available on the [Python Package Index][pip]:

Expand Down
56 changes: 30 additions & 26 deletions ccm
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,39 @@ def print_global_usage():
exit(1)


common.check_win_requirements()
def main():
common.check_win_requirements()

if len(sys.argv) <= 1:
print("Missing arguments")
print_global_usage()

arg1 = sys.argv[1].lower()

if arg1 in cluster_cmds.cluster_cmds():
kind = 'cluster'
cmd = arg1
cmd_args = sys.argv[2:]
else:
if len(sys.argv) <= 2:
if len(sys.argv) <= 1:
print("Missing arguments")
print_global_usage()
kind = 'node'
node = arg1
cmd = sys.argv[2]
cmd_args = [node] + sys.argv[3:]

cmd = get_command(kind, cmd)
if not cmd:
print("Unknown node or command: {0}".format(arg1))
exit(1)

parser = cmd.get_parser()
arg1 = sys.argv[1].lower()

if arg1 in cluster_cmds.cluster_cmds():
kind = 'cluster'
cmd = arg1
cmd_args = sys.argv[2:]
else:
if len(sys.argv) <= 2:
print("Missing arguments")
print_global_usage()
kind = 'node'
node = arg1
cmd = sys.argv[2]
cmd_args = [node] + sys.argv[3:]

cmd = get_command(kind, cmd)
if not cmd:
print("Unknown node or command: {0}".format(arg1))
exit(1)

parser = cmd.get_parser()

(options, args) = parser.parse_args(cmd_args)
cmd.validate(parser, options, args)

(options, args) = parser.parse_args(cmd_args)
cmd.validate(parser, options, args)
cmd.run()

cmd.run()
if __name__ == '__main__':
main()
33 changes: 33 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[tool.poetry]
name = "ccm"
version = "0.1.0"
license = "Apache-2.0"
description = "Cassandra Cluster Manager"
authors = ["Sylvain Lebresne <sylvain@datastax.com>"]
readme = "README.md"
repository = "https://github.com/scylladb/scylla-ccm"
packages = [
{ include = "ccmlib" },
]

[tool.poetry.scripts]
ccm = "ccm:main"

[tool.poetry.dependencies]
python = "^3.8"
ruamel-yaml = "^0.18.6"
psutil = "^6.0.0"
requests = "^2.32.3"
packaging = "^24.1"
boto3 = "^1.35.32"
tqdm = "^4.66.5"
urllib3 = "<2"

[tool.poetry.group.test.dependencies]
pytest = "*"
awscli = "*"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 0 additions & 2 deletions requirements-test.txt

This file was deleted.

39 changes: 0 additions & 39 deletions setup.py

This file was deleted.