Skip to content

Commit 780fb0a

Browse files
authored
Merge pull request #124 from CMSgov/brandon/BB2-4376-v3-changes
Brandon/bb2 4376 v3 changes
2 parents e87c66e + ee31045 commit 780fb0a

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,6 @@ wheels/
6363

6464
# Installer logs
6565
pip-log.txt
66-
pip-delete-this-directory.txt
66+
pip-delete-this-directory.txt
67+
# Snyk Security Extension - AI Rules (auto-generated)
68+
.github/instructions/snyk_rules.instructions.md

README-bb2-dev.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,51 @@ To show the version installed:
7575
docker-compose exec server pip show cms-bluebutton-sdk
7676
```
7777

78+
### Testing Locally
79+
80+
This information is repeated from the SDK (https://github.com/CMSgov/cms-bb2-python-sdk/blob/main/README-sdk-dev.md). It is here for ease of reference as it contains steps relating to the sample client as well.
81+
The current method for seeing the SDK in action is fairly complex, as it requires also setting up the Python sample client (this repo). These both, of course, depend upon the web-server repo for most of their logic. It is possible that in order to fully understand an issue that arises within the SDK or the sample client, a developer would have to track changes across 3 separate projects. There should be some future work to simplify this process as it is very manual and laborious.
82+
83+
The steps listed here are listed elsewhere in the documentation but for the sake of convenience, they are partially repeated here
84+
and written together so that a developer should be able to follow this step by step.
85+
86+
The overall goals are to:
87+
88+
- Build a local version of the SDK
89+
- Run a local version of sample client that consumes a local version of the SDK
90+
91+
### Building a local version of the SDK
92+
93+
Run the following commands in the base of the SDK repository. The commands suppose that you have the Python sample client cloned in the same folder as this SDK repo. Do not be in a virtualenv while running these commands.
94+
95+
```
96+
rm -rf build/
97+
python -m build --wheel --o ../bluebutton-sample-client-python-react/server
98+
```
99+
100+
The --o (or outdir) command should effectively 'copy paste' the built version of the .whl file into where it would be needed for the sample client. If you do not want it in the sample client, omit the --o and file path.
101+
102+
### Run a local version of sample client that consumes a local version of the SDK
103+
104+
Ensure that in bluebutton-sample-client-python-react/server/Dockerfile, uncomment the following line. Replace the version number (1.0.4 in the example) of the .whl file with what has been generated from the previous build command.
105+
106+
```
107+
RUN pip install cms_bluebutton_sdk-1.0.4-py3-none-any.whl
108+
```
109+
110+
In bluebutton-sample-client-python-react/server/Pipfile, add this line:
111+
112+
```
113+
cms-bluebutton-sdk = {file = "./cms_bluebutton_sdk-1.0.4-py3-none-any.whl"}
114+
```
115+
116+
In the base repository of bluebutton-sample-client-python-react, run the following commands. Ensure that you have no currently running containers or images of the sample client.
117+
118+
```
119+
cd server
120+
unzip -l cms_bluebutton_sdk-1.0.4-py3-none-any.whl
121+
pip install cms_bluebutton_sdk-1.0.4-py3-none-any.whl
122+
docker compose up
123+
```
124+
125+
Each time a change is made in the SDK, you must repeat all of the previous steps of building and re-running a local sample client. You must also ensure that the containers and images are removed each time.

server/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN if [ "$BUILD_DEVELOPMENT" = "True" ]; then \
1919
pip install cms-bluebutton-sdk; \
2020
fi
2121

22+
# If using a local version of the sdk, copy the wheel file and install it
23+
# RUN pip install cms_bluebutton_sdk-1.0.4-py3-none-any.whl
2224
RUN pipenv lock
2325
RUN pip install click
2426
RUN pipenv install --system --deploy --ignore-pipfile

0 commit comments

Comments
 (0)