Skip to content

Commit

Permalink
refactor: rename the ic-canister-http-adapter package, binaries and s…
Browse files Browse the repository at this point in the history
…ystemd files to ic-https-outcalls-adapter
  • Loading branch information
rumenov committed Jan 31, 2023
1 parent 0d165ff commit c948c4c
Show file tree
Hide file tree
Showing 23 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ prestorecon.o
**/boot/version.txt
**/bin/canister_sandbox
**/bin/ic-btc-adapter
**/bin/ic-canister-http-adapter
**/bin/ic-https-outcalls-adapter
**/bin/ic-consensus-pool-util
**/bin/ic-crypto-csp
**/bin/ic-regedit
Expand Down
2 changes: 1 addition & 1 deletion ic-os/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _image_deps(mode, malicious = False):
"//publish/binaries:canister_sandbox": "/opt/ic/bin/canister_sandbox:0755",
"//publish/binaries:ic-btc-adapter": "/opt/ic/bin/ic-btc-adapter:0755",
"//publish/binaries:ic-consensus-pool-util": "/opt/ic/bin/ic-consensus-pool-util:0755",
"//publish/binaries:ic-canister-http-adapter": "/opt/ic/bin/ic-canister-http-adapter:0755",
"//publish/binaries:ic-https-outcalls-adapter": "/opt/ic/bin/ic-https-outcalls-adapter:0755",
"//publish/binaries:ic-crypto-csp": "/opt/ic/bin/ic-crypto-csp:0755",
"//publish/binaries:ic-onchain-observability-adapter": "/opt/ic/bin/ic-onchain-observability-adapter:0755",
"//publish/binaries:ic-regedit": "/opt/ic/bin/ic-regedit:0755",
Expand Down
2 changes: 1 addition & 1 deletion ic-os/guestos/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ RUN addgroup --system nonconfidential && \
addgroup --system vsock && \
addgroup --system ic-registry-local-store

# The "ic-http-adapter" account. Used to run `ic-canister-http-adapter` binary
# The "ic-http-adapter" account. Used to run `ic-https-outcalls-adapter` binary
# to allow nodes to make HTTP calls.
RUN addgroup ic-http-adapter && \
adduser --system --disabled-password --shell /usr/sbin/nologin -c "IC Canister HTTP Adapter" ic-http-adapter && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ Description=IC Canister HTTP Provider
# state files and may also be needed to obtain network config.
After=bootstrap-ic-node.service
Wants=bootstrap-ic-node.service
Requires=ic-canister-http-adapter.socket
Requires=ic-https-outcalls-adapter.socket
StartLimitIntervalSec=0

[Service]
User=ic-http-adapter
Environment=RUST_BACKTRACE=1
ExecStartPre=+/opt/ic/bin/generate-canister-http-adapter-config.sh -o /run/ic-node/config/ic-canister-http-adapter.json
ExecStart=/opt/ic/bin/ic-canister-http-adapter /run/ic-node/config/ic-canister-http-adapter.json
ExecStartPre=+/opt/ic/bin/generate-canister-http-adapter-config.sh -o /run/ic-node/config/ic-https-outcalls-adapter.json
ExecStart=/opt/ic/bin/ic-https-outcalls-adapter /run/ic-node/config/ic-https-outcalls-adapter.json
NotifyAccess=main
Restart=always

[Install]
WantedBy=ic-replica.service
Also=ic-canister-http-adapter.socket
Also=ic-https-outcalls-adapter.socket
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
function usage() {
cat <<EOF
Usage:
generate-canister-http-adapter-config -o ic-canister-http-adapter.json5
generate-canister-http-adapter-config -o ic-https-outcalls-adapter.json5
Generate the canister http adapter config.
Expand Down
2 changes: 1 addition & 1 deletion ic-os/guestos/rootfs/opt/ic/share/ic.json5.template
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
bitcoin_mainnet_uds_metrics_path: "/run/ic-node/bitcoin-mainnet-adapter/metrics",
// IPC socket and metrics path for canister http adapter. These UDS path has to be the same as
// specified in the systemd socket file.
// The canister http adapter socket file is: /ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.socket
// The canister http adapter socket file is: /ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.socket
canister_http_uds_path: "/run/ic-node/canister-http-adapter/socket",
canister_http_uds_metrics_path: "/run/ic-node/canister-http-adapter/metrics",
},
Expand Down
2 changes: 1 addition & 1 deletion ic-os/guestos/rootfs/prep/ic-node/ic-node.fc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/opt/ic/bin/orchestrator -- gen_context(system_u:object_r:ic_orchestrator_exec_t,s0)
/opt/ic/bin/replica -- gen_context(system_u:object_r:ic_replica_exec_t,s0)
/opt/ic/bin/ic-canister-http-adapter -- gen_context(system_u:object_r:ic_http_adapter_exec_t,s0)
/opt/ic/bin/ic-https-outcalls-adapter -- gen_context(system_u:object_r:ic_http_adapter_exec_t,s0)
/opt/ic/bin/canister_sandbox -- gen_context(system_u:object_r:ic_canister_sandbox_exec_t,s0)
/opt/ic/bin/ic_monitoring_canister_adapter -- gen_context(system_u:object_r:ic_monitoring_canister_adapter_exec_t,s0)
/var/lib/ic/backup(/.*)? gen_context(system_u:object_r:ic_data_t,s0)
Expand Down
2 changes: 1 addition & 1 deletion ic-os/guestos/rootfs/prep/ic-node/ic-node.te
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ dontaudit ic_canister_sandbox_t ic_canister_sandbox_t : process { signal };
dontaudit ic_canister_sandbox_t cert_t : file { read };

###############################################################################
# ic-canister-http-adapter
# ic-https-outcalls-adapter

application_domain(ic_http_adapter_t, ic_http_adapter_exec_t)

Expand Down
2 changes: 1 addition & 1 deletion ic-os/guestos/scripts/build-disk-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ make -C ${BASE_DIR}/src infogetty prestorecon

# Compute arguments for actual build stage.

declare -a IC_EXECUTABLES=(orchestrator replica canister_sandbox sandbox_launcher vsock_agent state-tool ic-consensus-pool-util ic-crypto-csp ic-regedit ic-recovery ic-btc-adapter ic-canister-http-adapter ic-onchain-observability-adapter)
declare -a IC_EXECUTABLES=(orchestrator replica canister_sandbox sandbox_launcher vsock_agent state-tool ic-consensus-pool-util ic-crypto-csp ic-regedit ic-recovery ic-btc-adapter ic-https-outcalls-adapter ic-onchain-observability-adapter)
declare -a INSTALL_EXEC_ARGS=()
for IC_EXECUTABLE in "${IC_EXECUTABLES[@]}"; do
INSTALL_EXEC_ARGS+=("${EXEC_SRCDIR}/${IC_EXECUTABLE}:/opt/ic/bin/${IC_EXECUTABLE}:0755")
Expand Down
2 changes: 1 addition & 1 deletion ic-os/guestos/scripts/build-update-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ make -C ${BASE_DIR}/src infogetty prestorecon

# Compute arguments for actual build stage.

declare -a IC_EXECUTABLES=(orchestrator replica canister_sandbox sandbox_launcher vsock_agent state-tool ic-consensus-pool-util ic-crypto-csp ic-regedit ic-recovery ic-btc-adapter ic-canister-http-adapter ic-onchain-observability-adapter)
declare -a IC_EXECUTABLES=(orchestrator replica canister_sandbox sandbox_launcher vsock_agent state-tool ic-consensus-pool-util ic-crypto-csp ic-regedit ic-recovery ic-btc-adapter ic-https-outcalls-adapter ic-onchain-observability-adapter)
declare -a INSTALL_EXEC_ARGS=()
for IC_EXECUTABLE in "${IC_EXECUTABLES[@]}"; do
INSTALL_EXEC_ARGS+=("${EXEC_SRCDIR}/${IC_EXECUTABLE}:/opt/ic/bin/${IC_EXECUTABLE}:0755")
Expand Down
2 changes: 1 addition & 1 deletion policy-monitoring/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ artifacts/
**/bin/replica
**/bin/ic-crypto-csp
**/bin/ic-btc-adapter
**/bin/ic-canister-http-adapter
**/bin/ic-https-outcalls-adapter
**/bin/ic-onchain-observability-adapter
**/bin/state-tool
**/disk.img
2 changes: 1 addition & 1 deletion policy-monitoring/pipeline/es_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def is_host_reboot_intent(self) -> bool:
"orchestrator",
"ic-btc-adapter",
"ic-crypto-csp",
"ic-canister-http-adapter",
"ic-https-outcalls-adapter",
"ic-onchain-observability-adapter",
# TODO: all components that use the ReplicaLogger library
]
Expand Down
4 changes: 2 additions & 2 deletions publish/binaries/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LINUX_ONLY = [
NO_STRIP = [
"canister_sandbox",
"ic-btc-adapter",
"ic-canister-http-adapter",
"ic-https-outcalls-adapter",
"ic-onchain-observability-adapter",
"replica",
]
Expand All @@ -29,7 +29,7 @@ BINARIES = {
"ic-backup": "//rs/backup:ic-backup",
"ic-balance-exporter": "//rs/boundary_node/ic_balance_exporter:ic-balance-exporter",
"ic-starter": "//rs/starter:ic-starter",
"ic-canister-http-adapter": "//rs/https_outcalls/adapter:ic-canister-http-adapter",
"ic-https-outcalls-adapter": "//rs/https_outcalls/adapter:ic-https-outcalls-adapter",
"ic-consensus-pool-util": "//rs/artifact_pool:ic-consensus-pool-util",
"ic-crypto-csp": "//rs/crypto:ic-crypto-csp",
"ic-onchain-observability-adapter": "//rs/monitoring/onchain_observability/adapter:ic-onchain-observability-adapter",
Expand Down
76 changes: 38 additions & 38 deletions rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rs/bitcoin/adapter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ pub async fn main() {
// metrics socket as FD(4).
// SAFETY: The process is managed by systemd and is configured to start with at metrics socket.
// Additionally this function is only called once here.
// Systemd Socket config: ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.socket
// Systemd Service config: ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.service
// Systemd Socket config: ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.socket
// Systemd Service config: ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.service
if config.incoming_source == IncomingSource::Systemd {
unsafe {
start_metrics_grpc(metrics_registry.clone(), logger.clone());
Expand Down
2 changes: 1 addition & 1 deletion rs/config/src/config_sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ pub const SAMPLE_CONFIG: &str = r#"
bitcoin_testnet_uds_path: "/tmp/bitcoin_uds",
// IPC socket path for canister http adapter. This UDS path has to be the same as
// specified in the systemd socket file.
// The canister http adapter socket file is: /ic-os/guestos/rootfs/systemd/system/ic-canister-http-adapter.socket
// The canister http adapter socket file is: /ic-os/guestos/rootfs/systemd/system/ic-https-outcalls-adapter.socket
canister_http_uds_path: "/run/ic-node/canister-http-adapter/socket",
},
}
Expand Down
4 changes: 2 additions & 2 deletions rs/https_outcalls/adapter/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ rust_library(
name = "adapter",
srcs = glob(["src/**"]),
aliases = ALIASES,
crate_name = "ic_canister_http_adapter",
crate_name = "ic_https_outcalls_adapter",
proc_macro_deps = MACRO_DEPENDENCIES,
version = "0.1.0",
deps = DEPENDENCIES,
)

rust_binary(
name = "ic-canister-http-adapter",
name = "ic-https-outcalls-adapter",
srcs = ["src/main.rs"],
aliases = ALIASES,
proc_macro_deps = MACRO_DEPENDENCIES,
Expand Down
2 changes: 1 addition & 1 deletion rs/https_outcalls/adapter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "ic-canister-http-adapter"
name = "ic-https-outcalls-adapter"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
10 changes: 5 additions & 5 deletions rs/https_outcalls/adapter/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/// This binary is managed by systemd and added to the replica image.
/// The replica communicates with the HTTP adapter over unix domain sockets.
/// Relevant configuration files:
/// systemd service ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.service
/// systemd socket ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.socket
/// systemd service ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.service
/// systemd socket ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.socket
use clap::Parser;
use ic_adapter_metrics_server::start_metrics_grpc;
use ic_async_utils::{abort_on_panic, incoming_from_first_systemd_socket, incoming_from_path};
use ic_canister_http_adapter::{AdapterServer, Cli, IncomingSource};
use ic_https_outcalls_adapter::{AdapterServer, Cli, IncomingSource};
use ic_logger::{error, info, new_replica_logger_from_config};
use ic_metrics::MetricsRegistry;
use serde_json::to_string_pretty;
Expand Down Expand Up @@ -35,8 +35,8 @@ pub async fn main() {
// metrics socket as FD(4).
// SAFETY: The process is managed by systemd and is configured to start with at metrics socket.
// Additionally this function is only called once here.
// Systemd Socket config: ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.socketi
// Systemd Service config: ic-os/guestos/rootfs/etc/systemd/system/ic-canister-http-adapter.service
// Systemd Socket config: ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.socketi
// Systemd Service config: ic-os/guestos/rootfs/etc/systemd/system/ic-https-outcalls-adapter.service
if config.incoming_source == IncomingSource::Systemd {
unsafe {
start_metrics_grpc(metrics_registry.clone(), logger.clone());
Expand Down
2 changes: 1 addition & 1 deletion rs/https_outcalls/adapter/tests/server_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
mod test {
use futures::TryFutureExt;
use http::{header::HeaderValue, StatusCode};
use ic_canister_http_adapter::{AdapterServer, Config};
use ic_canister_http_service::{
canister_http_service_client::CanisterHttpServiceClient, CanisterHttpSendRequest,
HttpMethod,
};
use ic_https_outcalls_adapter::{AdapterServer, Config};
use ic_logger::replica_logger::no_op_logger;
use ic_metrics::MetricsRegistry;
use once_cell::sync::OnceCell;
Expand Down
2 changes: 1 addition & 1 deletion scalability/common/flamegraphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def start_iteration(self, outdir):
f"sudo mkdir {TARGET_DIR}; "
f"sudo chmod 0777 {TARGET_DIR}; "
f"cp -f flamegraph {TARGET_DIR}; cd {TARGET_DIR}; "
f"sudo perf record -F {FREQUENCY} -p $(pidof ic-canister-http-adapter ic-btc-adapter ic-crypto-csp ic-onchain-observability-adapter orchestrator replica sandbox_launcher canister_sandbox | sed 's/ /,/g') --call-graph dwarf,16384 -g -o {TARGET_DIR}/perf.data"
f"sudo perf record -F {FREQUENCY} -p $(pidof ic-https-outcalls-adapter ic-btc-adapter ic-crypto-csp ic-onchain-observability-adapter orchestrator replica sandbox_launcher canister_sandbox | sed 's/ /,/g') --call-graph dwarf,16384 -g -o {TARGET_DIR}/perf.data"
),
os.path.join(outdir, "perf-{}.stdout.log".format(self.target)),
os.path.join(outdir, "perf-{}.stderr.log".format(self.target)),
Expand Down
2 changes: 1 addition & 1 deletion scalability/common/machine_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_services():
return [
"ic-replica",
"ic-btc-adapter",
"ic-canister-http-adapter",
"ic-https-outcalls-adapter",
"ic-crypto-csp",
"ic-onchain-observability-adapter",
]
Expand Down

0 comments on commit c948c4c

Please sign in to comment.