-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sample-data-service mock infra client data #4398
Conversation
Deploy preview for chef-automate ready! Built with commit 7565e9e |
products.meta
Outdated
"name": "sample-data", | ||
"type": "product", | ||
"dependencies": ["automate"], | ||
"services": [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll want to list the new services in this service array as chef/sample-data-service
471278f
to
305d2da
Compare
build fc35c99adf07 is failing due to:
|
It looks like the testssl call, which checks all open ports, cannot connect to the new service, sample-data-service. Is it supposed to be running at all times? Or something you selectively start or do not start? I guess that either the port should be excluded from the scan targets or we should check that it really comes online. 🤔 |
Nevermind, the description says that you have to select it. I guess the testssl deployment (i.e. the "security" test run) doesn't do it. |
@vsingh-msys I've pushed a commit enabling the sample-data product for the security test. Let's see what happens now 😄 |
Looks like the security test now is green. ✔️ |
Yeah, thanks @srenatus |
if err != nil { | ||
fail(errors.Wrap(err, "Could not read certs")) | ||
} | ||
connFactory := secureconn.NewFactory(*serviceCerts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added service to get started maybe we can skip it later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working for me. The code looks good also.
Thank you for breaking this task up to only adding the service first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a reasonable start to me! Nice work. Left mostly minor comments.
Log log = 4; | ||
|
||
message Service { | ||
google.protobuf.StringValue host = 1 [deprecated=true]; // The listen host is no longer setable(localhost only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can avoid adding a deprecated option at the start of this service since no users have used this option yet.
@@ -0,0 +1 @@ | |||
# Sample data service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a bit of content here? What does the service do? How do you use it?
Sha: version.GitSHA, | ||
Built: version.BuildTime, | ||
}, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can get this by default via the debug API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted thanks!
- Add required config options Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
We still need configuration protobufs for this service. Signed-off-by: Steven Danna <steve@chef.io>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
f56c620
to
b94ab3c
Compare
# Helper methods specific for the sample-data-service | ||
|
||
document "start_sample_data_service" <<DOC | ||
Build and start the local sample-data-service |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's be consistent. Here you use "sample-data-service" and on the next function you use "Sample data service", and "sample data service" in other files. Suggest stick with "sample data service".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for nitpick suggestion!
install_if_missing core/jq-static jq | ||
install_if_missing core/grpcurl grpcurl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these necessary here? You are not using either one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, starting the service alone and installing grpcurl
& jq
would be handy so that grpcurl & jq
can be used in hab studio.
func DefaultConfigRequest() *ConfigRequest { | ||
c := NewConfigRequest() | ||
c.V1.Sys.Service.Host = w.String("127.0.0.1") | ||
c.V1.Sys.Service.Port = w.Int32(10155) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you determine this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can pick any of the port which is available in chef-automate dev ports free
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool; did not know that command!
verbose?="-v" | ||
endif | ||
|
||
all: lint build test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test
target is missing? Are there tests to run? If not, remove it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now, have added these helpers to the future building, removing test make sense we can add these helpers once required. Thanks!
mkdir -p bin/ | ||
go build -o bin/sample-data-service ./cmd/sample-data-service | ||
|
||
.PHONY: all static unit build compile proto test dep-ensure have-dep lint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.PHONY: all static unit build compile proto test dep-ensure have-dep lint | |
.PHONY: all static unit build test lint |
(And possibly remove test
as well per last comment.)
@@ -0,0 +1,5 @@ | |||
# Sample data service | |||
|
|||
Sample data service can be used to send scheduled data to Automate mimicing the data that would be send from a client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sample data service can be used to send scheduled data to Automate mimicing the data that would be send from a client. | |
Sample data service can be used to send scheduled data to Automate mimicking the data that would be send from a client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
"github.com/chef/automate/lib/tracing" | ||
) | ||
|
||
// Server is an sample-data server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Server is an sample-data server | |
// Server is a sample-data server |
service *service.Service | ||
} | ||
|
||
// NewServer returns an sample-data server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// NewServer returns an sample-data server | |
// NewServer returns a sample-data server |
return &Server{service: service} | ||
} | ||
|
||
// NewGRPCServer creates a grpc server that serves all Teams GRPC APIs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Teams??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy-pasted stuff forgot to update comment thanks!
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Hoping everything is as expected, merging this PR so proceeding with the further roadmap. 🤞 |
author Michael Sorens <msorens@chef.io> 1604676405 -0800 committer Alex Pop <apop@chef.io> 1605705520 +0000 Pin semgrep for custom rules (#4426) sample-data-service mock infra client data (#4398) Co-authored-by: Steven Danna <steve@chef.io> Compliance APIs default to 24h without end_time (#4310) * Compliance APIs default to 24h without end_time Signed-off-by: Alex Pop <apop@chef.io> Fix overlapping Signed-off-by: Alex Pop <apop@chef.io> * Update docker test based on new inspec error output Signed-off-by: Alex Pop <apop@chef.io> * Remove fmt package Signed-off-by: Alex Pop <apop@chef.io> Add option to select last 24h compliance report (#4358) * Add option to select last 24h compliance report This commit adds the option to view the last 24h of compliance data. Compliance API endpoints were recently updated to return last 24h window of data if `start_time` and `end_time` are excluded from requests. Signed-off-by: Scott Christopherson <scott@chef.io> * Align filters Signed-off-by: Alex Pop <apop@chef.io> * Update docker test based on new inspec error output Signed-off-by: Alex Pop <apop@chef.io> Co-authored-by: Alex Pop <apop@chef.io> Add Compliance Knowledge Transfer notes Signed-off-by: Alex Pop <apop@chef.io> small updates Signed-off-by: Alex Pop <apop@chef.io> before call Signed-off-by: Alex Pop <apop@chef.io> before call Signed-off-by: Alex Pop <apop@chef.io> added filters and migrations added some filter types ingest clarifications Signed-off-by: Alex Pop <apop@chef.io> Before second kt call Signed-off-by: Alex Pop <apop@chef.io> changes post second call Signed-off-by: Alex Pop <apop@chef.io>
author Michael Sorens <msorens@chef.io> 1604676405 -0800 committer Alex Pop <apop@chef.io> 1605705520 +0000 Pin semgrep for custom rules (#4426) sample-data-service mock infra client data (#4398) Co-authored-by: Steven Danna <steve@chef.io> Compliance APIs default to 24h without end_time (#4310) * Compliance APIs default to 24h without end_time Signed-off-by: Alex Pop <apop@chef.io> Fix overlapping Signed-off-by: Alex Pop <apop@chef.io> * Update docker test based on new inspec error output Signed-off-by: Alex Pop <apop@chef.io> * Remove fmt package Signed-off-by: Alex Pop <apop@chef.io> Add option to select last 24h compliance report (#4358) * Add option to select last 24h compliance report This commit adds the option to view the last 24h of compliance data. Compliance API endpoints were recently updated to return last 24h window of data if `start_time` and `end_time` are excluded from requests. Signed-off-by: Scott Christopherson <scott@chef.io> * Align filters Signed-off-by: Alex Pop <apop@chef.io> * Update docker test based on new inspec error output Signed-off-by: Alex Pop <apop@chef.io> Co-authored-by: Alex Pop <apop@chef.io> Add Compliance Knowledge Transfer notes Signed-off-by: Alex Pop <apop@chef.io> small updates Signed-off-by: Alex Pop <apop@chef.io> before call Signed-off-by: Alex Pop <apop@chef.io> before call Signed-off-by: Alex Pop <apop@chef.io> added filters and migrations added some filter types ingest clarifications Signed-off-by: Alex Pop <apop@chef.io> Before second kt call Signed-off-by: Alex Pop <apop@chef.io> changes post second call Signed-off-by: Alex Pop <apop@chef.io>
author Michael Sorens <msorens@chef.io> 1604676405 -0800 committer Alex Pop <apop@chef.io> 1605705520 +0000 Pin semgrep for custom rules (#4426) sample-data-service mock infra client data (#4398) Co-authored-by: Steven Danna <steve@chef.io> Compliance APIs default to 24h without end_time (#4310) * Compliance APIs default to 24h without end_time Signed-off-by: Alex Pop <apop@chef.io> Fix overlapping Signed-off-by: Alex Pop <apop@chef.io> * Update docker test based on new inspec error output Signed-off-by: Alex Pop <apop@chef.io> * Remove fmt package Signed-off-by: Alex Pop <apop@chef.io> Add option to select last 24h compliance report (#4358) * Add option to select last 24h compliance report This commit adds the option to view the last 24h of compliance data. Compliance API endpoints were recently updated to return last 24h window of data if `start_time` and `end_time` are excluded from requests. Signed-off-by: Scott Christopherson <scott@chef.io> * Align filters Signed-off-by: Alex Pop <apop@chef.io> * Update docker test based on new inspec error output Signed-off-by: Alex Pop <apop@chef.io> Co-authored-by: Alex Pop <apop@chef.io> Add Compliance Knowledge Transfer notes Signed-off-by: Alex Pop <apop@chef.io> small updates Signed-off-by: Alex Pop <apop@chef.io> before call Signed-off-by: Alex Pop <apop@chef.io> before call Signed-off-by: Alex Pop <apop@chef.io> added filters and migrations added some filter types ingest clarifications Signed-off-by: Alex Pop <apop@chef.io> Before second kt call Signed-off-by: Alex Pop <apop@chef.io> changes post second call Signed-off-by: Alex Pop <apop@chef.io> Co-authored-by: Michael Sorens <msorens@chef.io>
🔩 Description: What code changed, and why?
This PR only responsible to run
sample-data-service
using various deploy options.Define sample-data-service as product and user can run this service using
--product sample-data
.⛓️ Related Resources
#4141
👍 Definition of Done
sample-data-service
is enabled and running.👟 How to Build and Test the Change
OR
OR
chef-automate status
✅ Checklist
📷 Screenshots, if applicable