Skip to content

Latest commit

 

History

History
117 lines (79 loc) · 3.21 KB

File metadata and controls

117 lines (79 loc) · 3.21 KB

Open Agentic Schema Framework Server

The schema server is an HTTP server that provides a convenient way to browse and use the OASF schema.

Local Usage

This section describes how to build and run the OASF Schema server.

Required Build Tools

The Schema server is written in Elixir using the Phoenix Web framework.

The Elixir site maintains a great installation page, see this for help.

Building the Schema Server

Elixir uses the mix build tool, which is included in the Elixir installation package.

Install the Build Tools

mix local.hex --force && mix local.rebar --force

Get the Dependencies

Change to the server directory, fetch, and compile the dependencies:

cd server
mix do deps.get, deps.compile

Compile the Source Code

mix compile

Testing Local Schema Changes

You can use mix test command to test the changes made to the schema. For example, to ensure the JSON files are correct or the attributes are defined, with this command:

SCHEMA_DIR=../schema SCHEMA_EXTENSION=extensions mix test

If everything is correct, then you should not see any errors or warnings.

Running the Schema Server

You can use the Elixir's interactive shell, IEx, to start the schema server use:

SCHEMA_DIR=../schema SCHEMA_EXTENSION=extensions iex -S mix phx.server

Now you can access the Schema server at localhost:8080.

Reloading the Schema

You can use the following command in the iex shell to force reloading the schema with extensions:

Schema.reload(["<extension folder>", "<extension folder>", ...])

Reload the core schema without extensions:

Schema.reload()

Reload the schema only with the example extension (note that the folder is relative to the SCHEMA_DIR folder):

Schema.reload(["extensions/example"])

Reload the schema with all extensions defined in the extensions folder (note that the folder is relative to the SCHEMA_DIR folder):

Schema.reload(["extensions"])

Reload the schema with extensions defined outside the SCHEMA_DIR folder (use an absolute or relative path):

Schema.reload(["/home/schema/cloud", "../dev-ext"])

Runtime Configuration

The schema server uses a number of environment variables.

Variable Name Description
HTTP_PORT The server HTTP port number, default: 8080
SCHEMA_DIR The directory containing the schema, default: ../schema
SCHEMA_EXTENSION The directory containing the schema extensions, relative to SCHEMA_DIR or absolute path
RELEASE_NODE The Erlang node name. Set it if you want to run more than one server on the same computer
SCHEMA_DIR=../schema SCHEMA_EXTENSION=extensions iex -S mix phx.server