diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f74514e4..768a681c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,8 +4,16 @@ on: push: pull_request: workflow_dispatch: + inputs: + deploy: + description: 'Deploy documentation' + type: boolean + required: true + default: false + schedule: + - cron: '00 4 * * *' # daily at 4AM release: - types: [created] + types: [created, published, released] jobs: build_docs: @@ -40,9 +48,12 @@ jobs: uses: supercharge/mongodb-github-action@1.6.0 - name: Start Sirepo Docker container - uses: NSLS-II/start-sirepo-action@v2 + uses: mrakitin/start-sirepo-action@add-port-parameter with: docker-binary: ${{ env.DOCKER_BINARY }} + sirepo-bluesky-branch: configurable-sirepo-port + sirepo-bluesky-repo: mrakitin/sirepo-bluesky + sirepo-port: 8001 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -100,7 +111,7 @@ jobs: - name: Deploy documentation to nsls-ii.github.io # if: github.repository_owner == 'NSLS-II' && github.ref_name == 'main' - if: github.event_name == 'release' + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy) # We pin to the SHA, not the tag, for security reasons. # https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501 # v3.7.3 diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 007955e9..86719b56 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -7,7 +7,7 @@ name: PyPI upload on: release: - types: [created] + types: [created, published, released] jobs: publish_pypi: diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index bd0dab11..ee589b63 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -40,9 +40,12 @@ jobs: uses: supercharge/mongodb-github-action@1.6.0 - name: Start Sirepo Docker container - uses: NSLS-II/start-sirepo-action@v2 + uses: mrakitin/start-sirepo-action@add-port-parameter with: docker-binary: ${{ env.DOCKER_BINARY }} + sirepo-bluesky-branch: configurable-sirepo-port + sirepo-bluesky-repo: mrakitin/sirepo-bluesky + sirepo-port: 8001 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 diff --git a/docs/source/notebooks/madx.ipynb b/docs/source/notebooks/madx.ipynb index 24ca93d5..4869a462 100644 --- a/docs/source/notebooks/madx.ipynb +++ b/docs/source/notebooks/madx.ipynb @@ -34,7 +34,7 @@ "from sirepo_bluesky.madx_flyer import MADXFlyer\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", "\n", - "connection = SirepoBluesky(\"http://localhost:8000\")\n", + "connection = SirepoBluesky(\"http://localhost:8001\")\n", "\n", "data, schema = connection.auth(\"madx\", \"00000002\")\n", "classes, objects = create_classes(\n", diff --git a/docs/source/notebooks/shadow.ipynb b/docs/source/notebooks/shadow.ipynb index ec9ef62d..033911a1 100644 --- a/docs/source/notebooks/shadow.ipynb +++ b/docs/source/notebooks/shadow.ipynb @@ -43,7 +43,7 @@ "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import BeamStatisticsReport, create_classes\n", "\n", - "connection = SirepoBluesky(\"http://localhost:8000\")\n", + "connection = SirepoBluesky(\"http://localhost:8001\")\n", "\n", "data, schema = connection.auth(\"shadow\", sim_id=\"00000002\")\n", "classes, objects = create_classes(connection=connection)\n", @@ -113,7 +113,7 @@ "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import BeamStatisticsReport, create_classes\n", "\n", - "connection = SirepoBluesky(\"http://localhost:8000\")\n", + "connection = SirepoBluesky(\"http://localhost:8001\")\n", "\n", "data, schema = connection.auth(\"shadow\", sim_id=\"00000002\")\n", "\n", diff --git a/docs/source/notebooks/srw.ipynb b/docs/source/notebooks/srw.ipynb index 237e2257..1c7ff9d9 100644 --- a/docs/source/notebooks/srw.ipynb +++ b/docs/source/notebooks/srw.ipynb @@ -43,7 +43,7 @@ "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", "\n", - "connection = SirepoBluesky(\"http://localhost:8000\")\n", + "connection = SirepoBluesky(\"http://localhost:8001\")\n", "\n", "data, schema = connection.auth(\"srw\", sim_id=\"00000002\")\n", "classes, objects = create_classes(connection=connection)\n", @@ -112,7 +112,7 @@ "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", "\n", - "connection = SirepoBluesky(\"http://localhost:8000\")\n", + "connection = SirepoBluesky(\"http://localhost:8001\")\n", "\n", "data, schema = connection.auth(\"srw\", sim_id=\"00000002\")\n", "classes, objects = create_classes(connection=connection)\n", @@ -195,7 +195,7 @@ "from sirepo_bluesky.sirepo_bluesky import SirepoBluesky\n", "from sirepo_bluesky.sirepo_ophyd import create_classes\n", "\n", - "connection = SirepoBluesky(\"http://localhost:8000\")\n", + "connection = SirepoBluesky(\"http://localhost:8001\")\n", "\n", "data, schema = connection.auth(\"srw\", sim_id=\"00000003\")\n", "classes, objects = create_classes(\n", diff --git a/scripts/start_sirepo.sh b/scripts/start_sirepo.sh index b4a432aa..b4604564 100644 --- a/scripts/start_sirepo.sh +++ b/scripts/start_sirepo.sh @@ -25,6 +25,7 @@ SIREPO_SRDB_HOST="${SIREPO_SRDB_HOST:-}" SIREPO_SRDB_HOST_RO="${SIREPO_SRDB_HOST_RO:-}" SIREPO_SRDB_GUEST="${SIREPO_SRDB_GUEST:-}" SIREPO_SRDB_ROOT="${SIREPO_SRDB_ROOT:-'/sirepo'}" +SIREPO_PORT="${SIREPO_PORT:-'8000'}" unset cmd _cmd docker_image SIREPO_DOCKER_CONTAINER_ID @@ -79,8 +80,8 @@ cmd_start="${docker_binary} run ${arg} --init ${remove_container} --name sirepo -e SIREPO_SRDB_ROOT=${SIREPO_SRDB_ROOT} \ -e SIREPO_COOKIE_IS_SECURE=false \ -e SIREPO_FEATURE_CONFIG_REACT_SIM_TYPES='' \ - -p 8000:8000 \ - -v $SIREPO_SRDB_HOST_RO:/SIREPO_SRDB_ROOT:ro,z " + -p ${SIREPO_PORT}:8000 \ + -v ${SIREPO_SRDB_HOST_RO}:/SIREPO_SRDB_ROOT:ro,z " cmd_extra="" if [ ! -z "${SIREPO_SRDB_HOST}" -a ! -z "${SIREPO_SRDB_GUEST}" ]; then diff --git a/sirepo_bluesky/tests/conftest.py b/sirepo_bluesky/tests/conftest.py index 995f3b5b..14f47c37 100644 --- a/sirepo_bluesky/tests/conftest.py +++ b/sirepo_bluesky/tests/conftest.py @@ -67,76 +67,76 @@ def make_dirs(): @pytest.fixture(scope="function") def srw_empty_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("srw", "emptysim") return connection @pytest.fixture(scope="function") def srw_youngs_double_slit_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("srw", "00000000") return connection @pytest.fixture(scope="function") def srw_basic_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("srw", "00000001") return connection @pytest.fixture(scope="function") def srw_tes_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("srw", "00000002") return connection @pytest.fixture(scope="function") def srw_ari_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("srw", "00000003") return connection @pytest.fixture(scope="function") def srw_chx_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("srw", "HXV1JQ5c") return connection @pytest.fixture(scope="function") def shadow_basic_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("shadow", "00000001") return connection @pytest.fixture(scope="function") def shadow_tes_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("shadow", "00000002") return connection @pytest.fixture(scope="function") def madx_resr_storage_ring_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("madx", "00000000") return connection @pytest.fixture(scope="function") def madx_bl1_compton_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("madx", "00000001") return connection @pytest.fixture(scope="function") def madx_bl2_triplet_tdc_simulation(make_dirs): - connection = SirepoBluesky("http://localhost:8000") + connection = SirepoBluesky("http://localhost:8001") data, _ = connection.auth("madx", "00000002") return connection