Skip to content

Commit a9018e0

Browse files
authored
Update to v0.5.0
Update python package and documentation from v0.4.2 to v0.5.0 [ committed by @mellis13 ] [ reviewed by @ashao ]
2 parents 7e04b09 + f3ede10 commit a9018e0

File tree

133 files changed

+5003
-3277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+5003
-3277
lines changed

.github/workflows/build_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ jobs:
5555
cp -r doc-branch/docs/* ./docs/
5656
rm -rf doc-branch
5757
58-
- name: build documentation with docker
58+
- name: Build documentation with docker
5959
run: make docks
6060

6161
- name: Commit files
6262
run: |
63-
git add -A
63+
git add -Af
6464
git config --local user.email "action@github.com"
6565
git config --local user.name "GitHub Action"
6666
git commit -m "Update develop documentation"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
strategy:
5454
fail-fast: false
5555
matrix:
56-
os: [ubuntu-20.04, macos-10.15]
56+
os: [ubuntu-20.04, macos-12]
5757

5858
steps:
5959
- uses: actions/checkout@v2
@@ -123,4 +123,4 @@ jobs:
123123
with:
124124
user: __token__
125125
password: ${{ secrets.PYPI }}
126-
#repository_url: https://test.pypi.org/legacy/
126+
#repository_url: https://test.pypi.org/legacy/

.github/workflows/run_tests.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ jobs:
4949
strategy:
5050
fail-fast: false
5151
matrix:
52-
os: [macos-10.15, ubuntu-20.04] # Operating systems
52+
os: [macos-12, ubuntu-20.04] # Operating systems
5353
compiler: [8] # GNU compiler version
5454
rai: [1.2.5, 1.2.7] # Redis AI versions
5555
py_v: [3.8, 3.9, '3.10'] # Python versions
5656
exclude:
5757
# Do not build with Redis AI 1.2.5 on MacOS
58-
- os: macos-10.15
58+
- os: macos-12
5959
rai: 1.2.5
6060
# Do not build Redis AI 1.2.5 with py3.10
6161
# as wheels for dependecies are not availble
@@ -128,3 +128,10 @@ jobs:
128128
with:
129129
fail_ci_if_error: true
130130
files: ./coverage.xml
131+
132+
- name: Run mypy
133+
# TF 2.6.2 has a dep conflict with new mypy versions
134+
if: (matrix.rai != '1.2.5')
135+
run: |
136+
python -m pip install .[mypy]
137+
make check-mypy

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__
77
htmlcov
88
smartsim.egg-info
99
tests/test_output
10+
docs/*
1011

1112
# Dependencies
1213
smartsim/_core/.third-party

.wci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
language: Python
2323

2424
release:
25-
version: 0.4.2
26-
date: 2023-04-12
25+
version: 0.5.0
26+
date: 2023-07-06
2727

2828
documentation:
2929
general: https://www.craylabs.org/docs/overview.html

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
include requirements.txt
21
include Makefile
32
graft smartsim/
43

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ check-lint:
107107
@pylint --rcfile=.pylintrc ./smartsim
108108

109109

110+
# help: check-mypy - run static type check
111+
.PHONY: check-mypy
112+
check-mypy:
113+
@mypy --config-file=./pyproject.toml
114+
115+
110116
# help:
111117
# help: Documentation
112118
# help: -------

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ before using it on your system. Each tutorial is a Jupyter notebook that can be
9999
which will run a jupyter lab with the tutorials, SmartSim, and SmartRedis installed.
100100

101101
```bash
102-
docker pull ghcr.io/craylabs/smartsim-tutorials:v0.4.2
103-
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.2
102+
docker pull ghcr.io/craylabs/smartsim-tutorials:v0.4.1
103+
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.1
104104
# click on link to open jupyter lab
105105
```
106106

@@ -452,7 +452,7 @@ which will run a jupyter lab with the tutorials, SmartSim, and SmartRedis instal
452452

453453
```bash
454454
docker pull ghcr.io/craylabs/smartsim-tutorials:v1
455-
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.2
455+
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.1
456456
```
457457
Each of the following examples can be found in the
458458
[SmartSim documentation](https://www.craylabs.org/docs/tutorials/getting_started/getting_started.html).

conftest.py

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import json
2828
import os
2929
import inspect
30-
import shutil
3130
import pytest
3231
import psutil
3332
import shutil
@@ -44,13 +43,15 @@
4443
from smartsim._core.config import CONFIG
4544
from smartsim.error import SSConfigError
4645
from subprocess import run
46+
import sys
4747

4848

4949
# Globals, yes, but its a testing file
5050
test_path = os.path.dirname(os.path.abspath(__file__))
5151
test_dir = os.path.join(test_path, "tests", "test_output")
5252
test_launcher = CONFIG.test_launcher
5353
test_device = CONFIG.test_device
54+
test_num_gpus = CONFIG.test_num_gpus
5455
test_nic = CONFIG.test_interface
5556
test_alloc_specs_path = os.getenv("SMARTSIM_TEST_ALLOC_SPEC_SHEET_PATH", None)
5657
test_port = CONFIG.test_port
@@ -73,6 +74,7 @@ def print_test_configuration():
7374
global test_nic
7475
global test_alloc_specs_path
7576
global test_port
77+
7678
print("TEST_SMARTSIM_LOCATION:", smartsim.__path__)
7779
print("TEST_PATH:", test_path)
7880
print("TEST_LAUNCHER:", test_launcher)
@@ -511,7 +513,7 @@ def _test_dir_path(caller_function, caller_fspath):
511513
return dir_path
512514

513515
@staticmethod
514-
def get_test_dir(caller_function=None, caller_fspath=None):
516+
def get_test_dir(caller_function=None, caller_fspath=None, level=1):
515517
"""Get path to test output.
516518
517519
This function should be called without arguments from within
@@ -530,7 +532,7 @@ def get_test_dir(caller_function=None, caller_fspath=None):
530532
:rtype: str
531533
"""
532534
if not caller_function or not caller_fspath:
533-
caller_frame = inspect.stack()[1]
535+
caller_frame = inspect.stack()[level]
534536
caller_fspath = caller_frame.filename
535537
caller_function = caller_frame.function
536538

@@ -541,7 +543,7 @@ def get_test_dir(caller_function=None, caller_fspath=None):
541543
return dir_path
542544

543545
@staticmethod
544-
def make_test_dir(caller_function=None, caller_fspath=None):
546+
def make_test_dir(caller_function=None, caller_fspath=None, level=1):
545547
"""Create test output directory and return path to it.
546548
547549
This function should be called without arguments from within
@@ -558,7 +560,7 @@ def make_test_dir(caller_function=None, caller_fspath=None):
558560
:rtype: str
559561
"""
560562
if not caller_function or not caller_fspath:
561-
caller_frame = inspect.stack()[1]
563+
caller_frame = inspect.stack()[level]
562564
caller_fspath = caller_frame.filename
563565
caller_function = caller_frame.function
564566

@@ -591,3 +593,38 @@ class MLUtils:
591593
def get_test_device():
592594
global test_device
593595
return test_device
596+
597+
@staticmethod
598+
def get_test_num_gpus():
599+
return test_num_gpus
600+
601+
@pytest.fixture
602+
def coloutils():
603+
return ColoUtils
604+
605+
class ColoUtils:
606+
def setup_test_colo(fileutils, db_type, exp, db_args):
607+
"""Setup things needed for setting up the colo pinning tests"""
608+
# get test setup
609+
test_dir = fileutils.make_test_dir(level=2)
610+
sr_test_script = fileutils.get_test_conf_path("send_data_local_smartredis.py")
611+
612+
# Create an app with a colo_db which uses 1 db_cpu
613+
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=sr_test_script)
614+
colo_model = exp.create_model(f"colocated_model", colo_settings)
615+
colo_model.set_path(test_dir)
616+
617+
if db_type in ['tcp', "deprecated"]:
618+
db_args["port"] = 6780
619+
db_args["ifname"] = "lo"
620+
621+
colocate_fun = {
622+
"tcp": colo_model.colocate_db_tcp,
623+
"deprecated": colo_model.colocate_db,
624+
"uds":colo_model.colocate_db_uds
625+
}
626+
colocate_fun[db_type](**db_args)
627+
# assert model will launch with colocated db
628+
assert colo_model.colocated
629+
# Check to make sure that limit_db_cpus made it into the colo settings
630+
return colo_model

doc/_static/version_names.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"version_names":[
33
"develop (unstable)",
4-
"0.4.2 (stable)",
4+
"0.5.0 (stable)",
5+
"0.4.2",
56
"0.4.1",
67
"0.4.0",
78
"0.3.2"
89
],
910
"version_urls": [
1011
"https://www.craylabs.org/develop/overview.html",
1112
"https://www.craylabs.org/docs/overview.html",
13+
"https://www.craylabs.org/docs/versions/0.4.2/overview.html",
1214
"https://www.craylabs.org/docs/versions/0.4.1/overview.html",
1315
"https://www.craylabs.org/docs/versions/0.4.0/overview.html",
1416
"https://www.craylabs.org/docs/versions/0.3.2/overview.html"

0 commit comments

Comments
 (0)