cmd/

directory
v0.0.0-...-65069d1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2024 License: BSD-3-Clause

README

cros-pubilsh

cros-publish provides various publish services for ChromiumOS. All of the services supports both CLI and server modes. Currently there are 3 pubish services:

  1. gcs-publish
  2. tko-publish
  3. rdb-publish

Design doc

go/cros-publish-dd

Testing services

The follow sections use gcs-publish as an example. tko-publish and rdb-publish follow the same pattern.

gcs-pubilsh (CLI)

All provided paths should absolute paths.

publish/cmd/gcs-publish$ go build .
publish/cmd/gcs-publish$ ./gcs-publish cli -input <input_file_path> -output <desired_output_file_path> -log-path <desired_log_path>

Examples:

  1. input_file_path = /usr/local/google/home/<...>/publish/cmd/gcs-publish/input.json
  2. desired_output_file_path = /usr/local/google/home/<...>/publish/cmd/gcs-publish/output.json
  3. desired_log_path = /usr/local/google/home/<...>/publish/cmd/gcs-publish/logs
gcs-pubilsh (Server)

Start gcs-publish server

publish/cmd/gcs-publish$ go build .
publish/cmd/gcs-publish$ ./gcs-publish server --port <port_number>
server_command.go: running server mode:
gcs_publish_server.go: gcs-publish-service listen to request at  [::]:44349

Examples: port_number = 44349 (Provide 0 if we want to start the server on a random available port)

Once the server has started, you may use grpc_cli to interact with the services. Example:

$ grpc_cli ls localhost:44349 chromiumos.test.api.GenericPublishService --channel_creds_type insecure
Publish
Publish

Create key.json file in the same folder(gcs-publish) where the binary lives. This file should have the GCS credentials that will be used for GCS upload. This info will be made part of the input soon and will be expected to provide this as part of input.

$ grpc_cli call localhost:38869 chromiumos.test.api.GenericPublishService.Publish --infile=input.textproto --channel_creds_type insecure
connecting to localhost:44349
name: "operations/655953d1-968f-4e61-96c8-8929c53c002a"
done: true
response {
  type_url: "type.googleapis.com/chromiumos.test.api.PublishResponse"
}
Rpc succeeded with OK status

Examples:

  1. input.textproto = http://go/paste/6585018561331200 (Please modify the aritifact_dir_path.path and gcs_path.path correctly)
  2. More examples are included in the examples folder.

Directories

Path Synopsis
Validations functions
Validations functions
metadata
Plain Old Go Object for persisting Server information
Plain Old Go Object for persisting Server information
cli
Responsible for the abstraction layer representing each command grouping
Responsible for the abstraction layer representing each command grouping
constants
Local constants to CrosProvision CLI
Local constants to CrosProvision CLI
server
GRPC Server impl
GRPC Server impl
Package main implements the cros-publish used to upload artifacts to GCS bucket.
Package main implements the cros-publish used to upload artifacts to GCS bucket.
cli
Responsible for the abstraction layer representing each command grouping
Responsible for the abstraction layer representing each command grouping
constants
Local constants to CrosProvision CLI
Local constants to CrosProvision CLI
server
GRPC Server impl
GRPC Server impl
Implements publish_service.proto (see proto for details)
Implements publish_service.proto (see proto for details)
mock_storage
Package mock_storage is a generated GoMock package.
Package mock_storage is a generated GoMock package.
cli
Responsible for the abstraction layer representing each command grouping
Responsible for the abstraction layer representing each command grouping
constants
Local constants to CrosProvision CLI
Local constants to CrosProvision CLI
server
GRPC Server impl
GRPC Server impl
cli
Responsible for the abstraction layer representing each command grouping
Responsible for the abstraction layer representing each command grouping
constants
Local constants to CrosProvision CLI
Local constants to CrosProvision CLI
server
GRPC Server impl
GRPC Server impl

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL