Skip to content

Commit

Permalink
chore: Rename admin to cloud (#1477)
Browse files Browse the repository at this point in the history
* chore: Rename admin to cloud
  • Loading branch information
karolisg authored Apr 25, 2023
1 parent a07ca91 commit e450c8b
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ db/
dozer-sql/data
**/**/target/
target/
!target/release/dozer
!target/release/dozer-admin
!target/release/dozer
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ workspaces/

# Local configuration for development
/dozer-config.yaml
dozer-admin-config.yaml
dozer-config.test.*
log4rs.yaml
.DS_Store
Expand All @@ -28,11 +27,9 @@ log4rs.yaml
logs/
*.log
register-postgres.test.json
dozer-admin/dozer.db
*.db
config/tests/local/*.json
config/tests/local/*.yaml
dozer-admin/ui/*
dozer-ui

# Integration test generated files
Expand Down
10 changes: 5 additions & 5 deletions dozer-orchestrator/src/simple/orchestrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use dozer_ingestion::connectors::{SourceSchema, TableInfo};
use dozer_sql::pipeline::builder::statement_to_pipeline;
use dozer_sql::pipeline::errors::PipelineError;
use dozer_types::crossbeam::channel::{self, Sender};
use dozer_types::grpc_types::admin::dozer_admin_client::DozerAdminClient;
use dozer_types::grpc_types::admin::{CreateAppRequest, StartRequest};
use dozer_types::grpc_types::cloud::dozer_cloud_client::DozerCloudClient;
use dozer_types::grpc_types::cloud::{CreateAppRequest, StartRequest};
use dozer_types::indicatif::MultiProgress;
use dozer_types::log::{info, warn};
use dozer_types::models::app_config::Config;
Expand Down Expand Up @@ -364,13 +364,13 @@ impl Orchestrator for SimpleOrchestrator {
info!("Authenticating for username: {:?}", username);
info!("Local dozer configuration path: {:?}", config_path);
// getting local dozer config file
let config_content = std::fs::read_to_string(&config_path)
let config_content = fs::read_to_string(&config_path)
.map_err(|e| DeployError::CannotReadConfig(config_path.into(), e))?;
// calling the target url with the config fetched
self.runtime.block_on(async move {
// 1. CREATE application
let mut client: DozerAdminClient<tonic::transport::Channel> =
DozerAdminClient::connect(target_url).await?;
let mut client: DozerCloudClient<tonic::transport::Channel> =
DozerCloudClient::connect(target_url).await?;
let response = client
.create_application(CreateAppRequest {
config: config_content,
Expand Down
26 changes: 13 additions & 13 deletions dozer-types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,52 +30,52 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.file_descriptor_set_path(out_dir.join("generated_films.bin"))
.compile(&["protos/films.proto"], &["protos"])?;

// Admin Service & Types
// Cloud Service & Types
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.extern_path(
".dozer.admin.AppConfig",
".dozer.cloud.AppConfig",
"crate::models::app_config::Config",
)
.extern_path(
".dozer.admin.ConnectionConfig",
".dozer.cloud.ConnectionConfig",
"crate::models::connection::ConnectionConfig",
)
.extern_path(
".dozer.admin.Connection",
".dozer.cloud.Connection",
"crate::models::connection::Connection",
)
.extern_path(
".dozer.admin.EthContract",
".dozer.cloud.EthContract",
"crate::ingestion_types::EthContract",
)
.extern_path(
".dozer.admin.EthereumFilter",
".dozer.cloud.EthereumFilter",
"crate::ingestion_types::EthereumFilter",
)
.extern_path(
".dozer.admin.KafkaConfig",
".dozer.cloud.KafkaConfig",
"crate::ingestion_types::KafkaConfig",
)
.extern_path(
".dozer.admin.SnowflakeConfig",
".dozer.cloud.SnowflakeConfig",
"crate::ingestion_types::SnowflakeConfig",
)
.extern_path(
".dozer.admin.GrpcConfig",
".dozer.cloud.GrpcConfig",
"crate::models::connection::GrpcConfig",
)
.extern_path(
".dozer.admin.EthereumConfig",
".dozer.cloud.EthereumConfig",
"crate::ingestion_types::EthConfig",
)
.extern_path(
".dozer.admin.PostgresConfig",
".dozer.cloud.PostgresConfig",
"crate::models::connection::PostgresConfig",
)
.file_descriptor_set_path(out_dir.join("admin.bin"))
.compile(&["protos/admin.proto"], &["protos"])
.file_descriptor_set_path(out_dir.join("cloud.bin"))
.compile(&["protos/cloud.proto"], &["protos"])
.unwrap();

Ok(())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";
package dozer.admin;
import "admin_types.proto";
package dozer.cloud;
import "cloud_types.proto";

service DozerAdmin {
service DozerCloud {
rpc create_application(CreateAppRequest) returns (AppResponse);
rpc parse_sql(ParseRequest) returns (ParseResponse);
rpc parse_yaml(ParseYamlRequest) returns (ParseYamlResponse);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
syntax = "proto3";
package dozer.admin;
package dozer.cloud;

message AppConfig {
string app_name = 2;
Expand Down
6 changes: 3 additions & 3 deletions dozer-types/src/grpc_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ pub mod ingest {
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("ingest");
}

pub mod admin {
pub mod cloud {
#![allow(clippy::derive_partial_eq_without_eq, clippy::large_enum_variant)]
tonic::include_proto!("dozer.admin");
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("admin");
tonic::include_proto!("dozer.cloud");
pub const FILE_DESCRIPTOR_SET: &[u8] = tonic::include_file_descriptor_set!("cloud");
}

// To be used in tests
Expand Down

0 comments on commit e450c8b

Please sign in to comment.