Skip to content

Commit

Permalink
Rebranding (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
roznawsk authored May 17, 2024
1 parent 8fe9f0d commit 16c9b91
Show file tree
Hide file tree
Showing 109 changed files with 159 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "protos"]
path = protos
url = https://github.com/jellyfish-dev/protos.git
url = https://github.com/fishjam-dev/protos.git
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Read the docs [here](https://fishjam-dev.github.io/python-server-sdk)
## Installation

```
pip install jellyfish-server-sdk
pip install fishjam-server-sdk
```

## Usage
Expand All @@ -24,7 +24,7 @@ The SDK exports two main classes for interacting with Fishjam server:
Create a `RoomApi` instance, providing the fishjam server address and api token

```python
from jellyfish import RoomApi
from fishjam import RoomApi

room_api = RoomApi(server_address="localhost:5002", server_api_token="development")
```
Expand All @@ -33,23 +33,23 @@ You can use it to interact with Fishjam, manage rooms, peers and components

```python
# Create a room
jellyfish_address, room = room_api.create_room(video_codec="h264", webhook_url="http://localhost:5000/webhook")
fishjam_address, room = room_api.create_room(video_codec="h264", webhook_url="http://localhost:5000/webhook")
# '127.0.0.1:5002', Room(components=[], config=RoomConfig(max_peers=None, video_codec=<RoomConfigVideoCodec.H264: 'h264'>, webhook_url='http://localhost:5000/webhook'), id='1d905478-ccfc-44d6-a6e7-8ccb1b38d955', peers=[])

# Add peer to the room
from jellyfish import PeerOptionsWebRTC
from fishjam import PeerOptionsWebRTC

peer_token, peer_webrtc = room_api.add_peer(room.id, options=PeerOptionsWebRTC())
# 'M8TUGhj-L11KpyG-2zBPIo', Peer(id='b1232c7e-c969-4450-acdf-ea24f3cdd7f6', status=<PeerStatus.DISCONNECTED: 'disconnected'>, type='webrtc')

# Add component to the room
from jellyfish import ComponentOptionsHLS
from fishjam import ComponentOptionsHLS

component_hls = room_api.add_component(room.id, options=ComponentOptionsHLS())
# ComponentHLS(id='5f062447-a9f7-45ed-8d1b-511f77dc78ae', properties=ComponentPropertiesHLS(low_latency=False, persistent=False, playable=False, subscribe_mode=<ComponentPropertiesHLSSubscribeMode.AUTO: 'auto'>, target_window_duration=None), type='hls')
```

All methods in `RoomApi` may raise one of the exceptions deriving from `jellyfish.errors.HTTPError`. They are defined in `jellyfish.errors`.
All methods in `RoomApi` may raise one of the exceptions deriving from `fishjam.errors.HTTPError`. They are defined in `fishjam.errors`.

#### Notifier

Expand All @@ -59,7 +59,7 @@ You can read more about notifications in the [Fishjam Docs](https://fishjam-dev.

Create `Notifier` instance
```python
from jellyfish import Notifier
from fishjam import Notifier

notifier = Notifier(server_address='localhost:5002', server_api_token='development')
```
Expand Down
6 changes: 3 additions & 3 deletions compile_proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ git submodule sync --recursive >> /dev/null
git submodule update --recursive --remote --init >> /dev/null
printf "DONE\n\n"

server_file="./protos/jellyfish/server_notifications.proto"
server_file="./protos/fishjam/server_notifications.proto"
printf "Compiling: file $server_file\n"
protoc -I . --python_betterproto_out=./jellyfish/events/_protos $server_file
protoc -I . --python_betterproto_out=./fishjam/events/_protos $server_file
printf "\tDONE\n"

peer_file="./protos/jellyfish/peer_notifications.proto"
peer_file="./protos/fishjam/peer_notifications.proto"
printf "Compiling: file $peer_file\n"
protoc -I . --python_betterproto_out=./tests/support/protos $peer_file
printf "\tDONE\n"
34 changes: 17 additions & 17 deletions docker-compose-test.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
version: "3"

services:
jellyfish:
image: "ghcr.io/fishjam-dev/jellyfish:${TAG:-edge}"
container_name: jellyfish
fishjam:
image: "ghcr.io/fishjam-dev/fishjam:${TAG:-edge}"
container_name: fishjam
restart: on-failure
healthcheck:
test: >
curl --fail -H "authorization: Bearer development" http://jellyfish:5002/room || exit 1
curl --fail -H "authorization: Bearer development" http://fishjam:5002/room || exit 1
interval: 3s
retries: 2
timeout: 2s
start_period: 30s
environment:
JF_HOST: "jellyfish:5002"
JF_INTEGRATED_TURN_IP: "${INTEGRATED_TURN_IP:-127.0.0.1}"
JF_INTEGRATED_TURN_LISTEN_IP: "0.0.0.0"
JF_INTEGRATED_TURN_PORT_RANGE: "50000-50050"
JF_INTEGRATED_TCP_TURN_PORT: "49999"
JF_SERVER_API_TOKEN: "development"
JF_PORT: 5002
JF_SECRET_KEY_BASE: "super-secret-key"
JF_SIP_USED: "true"
JF_SIP_IP: "127.0.0.1"
FJ_HOST: "fishjam:5002"
FJ_INTEGRATED_TURN_IP: "${INTEGRATED_TURN_IP:-127.0.0.1}"
FJ_INTEGRATED_TURN_LISTEN_IP: "0.0.0.0"
FJ_INTEGRATED_TURN_PORT_RANGE: "50000-50050"
FJ_INTEGRATED_TCP_TURN_PORT: "49999"
FJ_SERVER_API_TOKEN: "development"
FJ_PORT: 5002
FJ_SECRET_KEY_BASE: "super-secret-key"
FJ_SIP_IP: "127.0.0.1"
FJ_COMPONENTS_USED: rtsp file hls recording sip
ports:
- "5002:5002"
- "49999:49999"
- "50000-50050:50000-50050/udp"
volumes:
- ./tests/fixtures:/app/jellyfish_resources/file_component_sources
- ./tests/fixtures:/app/fishjam_resources/file_component_sources

test:
container_name: test
Expand All @@ -41,7 +41,7 @@ services:
volumes:
- .:/app
depends_on:
jellyfish:
fishjam:
condition: service_healthy

examples:
Expand All @@ -54,5 +54,5 @@ services:
volumes:
- .:/app
depends_on:
jellyfish:
fishjam:
condition: service_healthy
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=./api/jellyfish.html" />
<meta http-equiv="refresh" content="0; url=./api/fishjam.html" />
</head>

<link href="jellyfish.html" rel="import" />
<link href="fishjam.html" rel="import" />

</html>
2 changes: 1 addition & 1 deletion docs/server_notifications.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Server Notifications

Jellyfish sends server side notifications whenever some important event occurs, e.g.:
Fishjam sends server side notifications whenever some important event occurs, e.g.:
* a room has been created
* a peer has connected
* component has crashed
Expand Down
12 changes: 6 additions & 6 deletions examples/mini_tutorial.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import asyncio
import os

from jellyfish import (
from fishjam import (
ComponentOptionsFile,
ComponentOptionsHLS,
ComponentOptionsHLSSubscribeMode,
Notifier,
RoomApi,
)
from jellyfish.events import (
from fishjam.events import (
ServerMessageHlsPlayable,
ServerMessageTrackAdded,
ServerMessageTrackType,
)

HOST = "jellyfish" if os.getenv("DOCKER_TEST") == "TRUE" else "localhost"
HOST = "fishjam" if os.getenv("DOCKER_TEST") == "TRUE" else "localhost"
SERVER_ADDRESS = f"{HOST}:5002"


Expand Down Expand Up @@ -55,9 +55,9 @@ async def test_notifier():
# that allow to use HLS.
address, room = room_api.create_room(video_codec="h264")

# Create new room api with returned jellyfish address as a room could be
# created on a different jellyfish instance
# (if you communicate with a cluster of jellyfishes)
# Create new room api with returned fishjam address as a room could be
# created on a different fishjam instance
# (if you communicate with a cluster of fishjames)
room_api = RoomApi(server_address=address)

# Add HLS component with manual subscribe mode
Expand Down
8 changes: 4 additions & 4 deletions examples/room_api.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import os

from jellyfish import ComponentOptionsHLS, PeerOptionsWebRTC, RoomApi
from fishjam import ComponentOptionsHLS, PeerOptionsWebRTC, RoomApi

HOST = "jellyfish" if os.getenv("DOCKER_TEST") == "TRUE" else "localhost"
HOST = "fishjam" if os.getenv("DOCKER_TEST") == "TRUE" else "localhost"
SERVER_ADDRESS = f"{HOST}:5002"

# Create a room
room_api = RoomApi(server_address=SERVER_ADDRESS, server_api_token="development")

jellyfish_address, room = room_api.create_room(
fishjam_address, room = room_api.create_room(
video_codec="h264", webhook_url="http://localhost:5000/webhook"
)
print((jellyfish_address, room))
print((fishjam_address, room))

# Add peer to the room
result = room_api.add_peer(room.id, options=PeerOptionsWebRTC())
Expand Down
6 changes: 3 additions & 3 deletions examples/server_notifications.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import asyncio
import os

from jellyfish import Notifier, RoomApi
from jellyfish.events import ServerMessageTrackAdded, ServerMessageTrackType
from fishjam import Notifier, RoomApi
from fishjam.events import ServerMessageTrackAdded, ServerMessageTrackType

HOST = "jellyfish" if os.getenv("DOCKER_TEST") == "TRUE" else "localhost"
HOST = "fishjam" if os.getenv("DOCKER_TEST") == "TRUE" else "localhost"
SERVER_ADDRESS = f"{HOST}:5002"

notifier = Notifier(server_address=SERVER_ADDRESS, server_api_token="development")
Expand Down
12 changes: 6 additions & 6 deletions jellyfish/__init__.py → fishjam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
# pylint: disable=locally-disabled, no-name-in-module, import-error

# Exceptions and Server Messages
from jellyfish import errors, events
from fishjam import errors, events

# Models
from jellyfish._openapi_client.models import (
from fishjam._openapi_client.models import (
ComponentFile,
ComponentHLS,
ComponentOptionsFile,
Expand Down Expand Up @@ -40,10 +40,10 @@
)

# API
from jellyfish._webhook_notifier import receive_binary
from jellyfish._ws_notifier import Notifier
from jellyfish.api._recording_api import RecordingApi
from jellyfish.api._room_api import RoomApi
from fishjam._webhook_notifier import receive_binary
from fishjam._ws_notifier import Notifier
from fishjam.api._recording_api import RecordingApi
from fishjam.api._room_api import RoomApi

__all__ = [
"RoomApi",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" A client library for accessing Jellyfish Media Server """
""" A client library for accessing Fishjam Media Server """
from .client import AuthenticatedClient, Client

__all__ = (
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def sync_detailed(
*,
client: AuthenticatedClient,
) -> Response[Union[Error, HealthcheckResponse]]:
"""Describes the health of Jellyfish
"""Describes the health of Fishjam
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -72,7 +72,7 @@ def sync(
*,
client: AuthenticatedClient,
) -> Optional[Union[Error, HealthcheckResponse]]:
"""Describes the health of Jellyfish
"""Describes the health of Fishjam
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -91,7 +91,7 @@ async def asyncio_detailed(
*,
client: AuthenticatedClient,
) -> Response[Union[Error, HealthcheckResponse]]:
"""Describes the health of Jellyfish
"""Describes the health of Fishjam
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -112,7 +112,7 @@ async def asyncio(
*,
client: AuthenticatedClient,
) -> Optional[Union[Error, HealthcheckResponse]]:
"""Describes the health of Jellyfish
"""Describes the health of Fishjam
Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
from typing import TYPE_CHECKING, Any, Dict, List, Type, TypeVar, Union
from typing import (
TYPE_CHECKING,
Any,
Dict,
List,
Type,
TypeVar,
Union,
)

from attrs import define as _attrs_define
from attrs import field as _attrs_field
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@

@_attrs_define
class HealthReport:
"""Describes overall Jellyfish health"""
"""Describes overall Fishjam health"""

distribution: "HealthReportDistribution"
"""Informs about the status of Jellyfish distribution"""
"""Informs about the status of Fishjam distribution"""
git_commit: str
"""Commit hash of the build"""
status: HealthReportStatus
"""Informs about the status of Jellyfish or a specific service"""
"""Informs about the status of Fishjam or a specific service"""
uptime: int
"""Uptime of Jellyfish (in seconds)"""
"""Uptime of Fishjam (in seconds)"""
version: str
"""Version of Jellyfish"""
"""Version of Fishjam"""
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
"""@private"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@

@_attrs_define
class HealthReportDistribution:
"""Informs about the status of Jellyfish distribution"""
"""Informs about the status of Fishjam distribution"""

node_status: HealthReportStatus
"""Informs about the status of Jellyfish or a specific service"""
"""Informs about the status of Fishjam or a specific service"""
nodes_in_cluster: int
"""Amount of nodes (including this Jellyfish's node) in the distribution cluster"""
"""Amount of nodes (including this Fishjam's node) in the distribution cluster"""
enabled: Union[Unset, bool] = UNSET
"""Whether distribution is enabled on this Jellyfish"""
"""Whether distribution is enabled on this Fishjam"""
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
"""@private"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class HealthReportStatus(str, Enum):
"""Informs about the status of Jellyfish or a specific service"""
"""Informs about the status of Fishjam or a specific service"""

DOWN = "DOWN"
UP = "UP"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

@_attrs_define
class HealthcheckResponse:
"""Response containing health report of Jellyfish"""
"""Response containing health report of Fishjam"""

data: "HealthReport"
"""Describes overall Jellyfish health"""
"""Describes overall Fishjam health"""
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
"""@private"""

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class RoomConfig:
peerless_purge_timeout: Union[Unset, None, int] = UNSET
"""Duration (in seconds) after which the room will be removed if no peers are connected. If not provided, this feature is disabled."""
room_id: Union[Unset, None, str] = UNSET
"""Custom id used for identifying room within Jellyfish. Must be unique across all rooms. If not provided, random UUID is generated."""
"""Custom id used for identifying room within Fishjam. Must be unique across all rooms. If not provided, random UUID is generated."""
video_codec: Union[Unset, None, RoomConfigVideoCodec] = UNSET
"""Enforces video codec for each peer in the room"""
webhook_url: Union[Unset, None, str] = UNSET
"""URL where Jellyfish notifications will be sent"""
"""URL where Fishjam notifications will be sent"""
additional_properties: Dict[str, Any] = _attrs_field(init=False, factory=dict)
"""@private"""

Expand Down
Loading

0 comments on commit 16c9b91

Please sign in to comment.