You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+29-27Lines changed: 29 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -51,27 +51,27 @@ See TODO.adoc for more info.
51
51
52
52
== Build and run
53
53
54
-
Both normal execution and the test suite expect the prescence of some existing binaries (described below) to be locatable within the `$PATH` environment variable.
55
-
However, once these have been provided, the codebase should be buildable with `cargo build`, and testable with `cargo test`.
54
+
You can **format the code** using `cargo fmt`. Make sure to run this before pushing changes. The CI checks that the code is correctly formatted.
56
55
57
-
**Prerequisites:**
56
+
You can **run the https://github.com/rust-lang/rust-clippy[Clippy linter]** using `cargo clippy \-- -D warnings -A clippy::style`. Make sure to run this before pushing changes. The CI checks that the code is clippy-clean.
58
57
59
-
. Postgres
58
+
**Prerequisites:**
60
59
61
-
Postgres is required to link against libpq for access to the database.
60
+
Both normal execution and the test suite expect certain binaries (described below) on your PATH.
62
61
63
-
(See https://github.com/oxidecomputer/omicron/issues/213 ; we may be able to remove this dependency long-term)
62
+
. libpq, the PostgreSQL client library
63
+
+
64
+
--
65
+
We use Diesel's PostgreSQL support to connect to CockroachDB (which is wire-compatible with PostgreSQL). Diesel uses the native libpq to do this. You can get the client library with:
64
66
65
-
Linux: `sudo apt-get install libpq-dev`
66
-
Mac: `brew install postgresql`
67
-
Helios: `pkg install library/postgresql-13`
67
+
* Helios: `pkg install library/postgresql-13`
68
+
* Linux: `sudo apt-get install libpq-dev`
69
+
* Mac: `brew install postgresql`
68
70
69
-
Additionally, to help all runtime commands find this library, we recommend the following:
70
-
[source,text]
71
-
----
72
-
export LD_LIBRARY_PATH="$(pg_config --libdir)"
73
-
----
71
+
After doing this, you should have the `pg_config` command on your PATH. For example, on Helios, you'd want `/opt/ooce/bin` on your PATH.
74
72
73
+
See the note about setting RUSTFLAGS at build time below.
74
+
--
75
75
. CockroachDB v20.2.5.
76
76
+
77
77
The test suite expects to be able to start a single-node CockroachDB cluster using the `cockroach` executable on your PATH.
@@ -87,7 +87,7 @@ See <<_configuring_clickhouse>> for details on ClickHouse's setup and configurat
87
87
+
88
88
. Additional software requirements:
89
89
+
90
-
On an illumosbased machine (Helios, OmniOS), make sure your packages are up to date, and you have the `brand/sparse` package:
90
+
On an illumos-based machine (Helios, OmniOS), if you want to run the real (non-simulated) Sled Agent to run actual VMs with Propolis, make sure your packages are up to date, and you have the `brand/sparse` package:
91
91
+
92
92
[source,text]
93
93
----
@@ -96,10 +96,6 @@ pkg install pkg:/package/pkg
96
96
pkg update
97
97
----
98
98
99
-
You can **format the code** using `cargo fmt`. Make sure to run this before pushing changes. The CI checks that the code is correctly formatted.
100
-
101
-
You can **run the https://github.com/rust-lang/rust-clippy[Clippy linter]** using `cargo clippy \-- -D warnings -A clippy::style`. Make sure to run this before pushing changes. The CI checks that the code is clippy-clean.
102
-
103
99
To **run Omicron** you need to run four programs:
104
100
105
101
* a CockroachDB cluster. For development, you can use the `omicron-dev` tool in this repository to start a single-node CockroachDB cluster **that will delete the database when you shut it down.**
@@ -108,11 +104,17 @@ the database files will be deleted when you stop the program.
108
104
* `nexus`: the guts of the control plane
109
105
* `sled-agent-sim`: a simulator for the component that manages a single sled
110
106
111
-
The easiest way to start the required databases is to use the built in `omicron-dev` tool.
112
-
This tool assumes that the `cockroach` and `clickhouse` executables are on your PATH,
113
-
and match the versions above.
107
+
The easiest way to start the required databases is to use the built-in `omicron-dev` tool. This tool assumes that the `cockroach` and `clickhouse` executables are on your PATH, and match the versions above.
114
108
115
-
1. Start CockroachDB using `omicron-dev db-run`:
109
+
. Set `RUSTFLAGS` in your environment so that built binaries will be able to find your local copy of libpq. A typical example might look like this:
+ Note that this might be wrong in some configurations or if you're using environment variables to control how the `pq-sys` crate finds libpq. See https://github.com/oxidecomputer/omicron/issues/213[#213] for details.
115
+
+
116
+
NOTE: You may be able to skip this step if your libpq is in a directory that's already part of the runtime linker's default search path, which may be the case if you've installed libpq using the system package manager. This step is necessarily on Helios because the package manager does not put libpq on the default ld.so search path.
Note that as the output indicates, this cluster will be available to anybody that can reach 127.0.0.1.
169
171
170
-
2. Start the ClickHouse database server:
172
+
. Start the ClickHouse database server:
171
173
+
172
174
[source,text]
173
175
----
@@ -178,7 +180,7 @@ omicron-dev: running ClickHouse (PID: 2463), full command is "clickhouse server
178
180
omicron-dev: using /var/folders/67/2tlym22x1r3d2kwbh84j298w0000gn/T/.tmpJ5nhot for ClickHouse data storage
179
181
----
180
182
181
-
3. `nexus` requires a configuration file to run. You can use `omicron-nexus/examples/config.toml` to start with. Build and run it like this:
183
+
. `nexus` requires a configuration file to run. You can use `omicron-nexus/examples/config.toml` to start with. Build and run it like this:
182
184
+
183
185
[source,text]
184
186
----
@@ -187,11 +189,11 @@ $ cargo run --bin=nexus -- omicron-nexus/examples/config.toml
187
189
listening: http://127.0.0.1:12220
188
190
----
189
191
190
-
4. `sled-agent` only accepts configuration on the command line. Run it with a uuid identifying itself (this would be a uuid for the sled it's managing), an IP:port for itself, and the IP:port of `nexus`'s _internal_ interface. Using default config, this might look like this:
192
+
. `sled-agent-sim` only accepts configuration on the command line. Run it with a uuid identifying itself (this would be a uuid for the sled it's managing), an IP:port for itself, and the IP:port of `nexus`'s _internal_ interface. Using default config, this might look like this:
191
193
+
192
194
[source,text]
193
195
----
194
-
$ cargo run --bin=sled-agent -- run $(uuidgen) 127.0.0.1:12345 127.0.0.1:12221
196
+
$ cargo run --bin=sled-agent-sim -- run $(uuidgen) 127.0.0.1:12345 127.0.0.1:12221
195
197
...
196
198
Jun 02 12:21:50.989 INFO listening, local_addr: 127.0.0.1:12345, component: dropshot
0 commit comments