Skip to content

Commit 93b5431

Browse files
- Pared back.
1 parent b999a20 commit 93b5431

File tree

11 files changed

+153
-99
lines changed

11 files changed

+153
-99
lines changed

.vscode/launch.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@
155155
"select JSON_EXTRACT(saml.samlIdentity, '$.username') as saml_username from github.scim.saml_ids saml where saml.org = 'dummyorg';",
156156
"select kind, name, maximumCardsPerInstance from google.compute.acceleratorTypes where project = 'defective-response-content-project' and zone = 'australia-southeast1-a' order by name desc;",
157157
"registry pull google;",
158-
"create materialized view nv as select BackupId, BackupState from aws.cloudhsm.backups where region = 'ap-southeast-2' order by BackupId;",
159-
"SELECT instance_id FROM aws.ec2.instances WHERE region IN ('us-east-1', 'ap-southeast-2');",
160-
"SELECT instance_id FROM aws.ec2_solid_gold.instances WHERE region IN ('us-east-1', 'ap-southeast-2');",
161-
"SELECT region FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id; SELECT region, instance_id, tenancy, security_groups FROM aws.ec2_nextgen.instances WHERE region IN ('us-east-1', 'ap-southeast-2', 'ap-southeast-1') order by region, instance_id;",
158+
"create materialized view nv as select BackupId, BackupState from aws.cloudhsm.backups where region = 'ap-southeast-2' order by BackupId;"
162159
],
163160
"default": "show providers;"
164161
},
@@ -185,13 +182,12 @@
185182
"type": "pickString",
186183
"id": "authString",
187184
"description": "Auth Input arg String",
188-
"default": "{}",
185+
"default": "{ \"azure\": { \"type\": \"azure_default\" }, \"digitalocean\": { \"type\": \"bearer\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/digitalocean-key.txt\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/ryuk-it-query.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
189186
"options": [
190187
"{ \"azure\": { \"type\": \"azure_default\" }, \"digitalocean\": { \"type\": \"bearer\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/digitalocean-key.txt\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/ryuk-it-query.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
191188
"{ \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/google/functional-test-dummy-sa-key.json\" }, \"googleadmin\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/google/functional-test-dummy-sa-key.json\" },s \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/okta/api-key.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/okta/api-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/aws/functional-test-dummy-aws-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/netlify/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/k8s/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/test/assets/credentials/dummy/sumologic/sumologic-token.txt\", \"type\": \"basic\" } }",
192189
"{ \"pgi\": { \"type\": \"sql_data_source::postgres\", \"sqlDataSource\": { \"dsn\": \"postgres://stackql:[email protected]:8432\" } }, \"azure\": { \"type\": \"azure_default\" }, \"google\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/stackql-security-reviewer.json\" }, \"okta\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/okta-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"SSWS \" }, \"github\": { \"type\": \"basic\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/github-key.txt\" }, \"aws\": { \"type\": \"aws_signing_v4\", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/aws-secret-key.txt\", \"keyID\": \"AKIA376P4FQSS2ONB2NS\" }, \"netlify\": { \"type\": \"api_key\", \"valuePrefix\": \"Bearer \", \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/netlify-token.txt\" }, \"k8s\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/k8s-token.txt\", \"type\": \"api_key\", \"valuePrefix\": \"Bearer \" }, \"sumologic\": { \"credentialsfilepath\": \"${workspaceFolder}/cicd/keys/integration/sumologic-token.txt\", \"type\": \"basic\" } }",
193-
"{ \"digitalocean\": { \"username_var\": \"DUMMY_DIGITALOCEAN_USERNAME\", \"password_var\": \"DUMMY_DIGITALOCEAN_PASSWORD\", \"type\": \"bearer\" } }",
194-
"{}"
190+
"{ \"digitalocean\": { \"username_var\": \"DUMMY_DIGITALOCEAN_USERNAME\", \"password_var\": \"DUMMY_DIGITALOCEAN_PASSWORD\", \"type\": \"bearer\" } }"
195191
]
196192
},
197193
{
@@ -385,7 +381,12 @@
385381
{
386382
"name": "generic exec",
387383
"type": "go",
388-
"envFile": "${workspaceFolder}/.vscode/.env",
384+
"env": {
385+
"DUMMY_DIGITALOCEAN_USERNAME": "myusername",
386+
"DUMMY_DIGITALOCEAN_PASSWORD": "mypassword",
387+
"DD_API_KEY": "myusername",
388+
"DD_APPLICATION_KEY": "mypassword"
389+
},
389390
"request": "launch",
390391
"mode": "debug",
391392
"program": "${workspaceFolder}/stackql",

docs/walkthroughs/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ in order to setup, run, verify and tear down testing scenarios. The tests *can*
1616

1717
## Running from CI
1818

19-
The canonical, **ruleset-protected** tag form is `scenario-<<run_number>>-<<anything>>`. At this stage, `run_number` must refer to a `stackql` run for which a `linux` `amd64` stackql binary archive is present at the time the tag is run.
19+
The canonical, **ruleset-protected** tag form is `scenario-<run_number>-<anything>`. At this stage, `run_number` must refer to a `stackql` run for which a `linux` `amd64` stackql binary archive is present at the time the tag is run.
2020

2121

22-
## Plumbing
23-
24-
These walkthroughs are runnable using CI. This is built upon:
25-
26-
- `jinja2` templates, with `<<` and `>>` as delimiters.
27-
2822

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
## Setup
3+
4+
First, create a google service account key using the GCP Console, per [the GCP documentation](https://cloud.google.com/iam/docs/keys-create-delete). Grant the service account at least `Viewer` role equivalent privileges, per [the GCP dumentation](https://cloud.google.com/iam/docs/create-service-agents#grant-roles).
5+
6+
Then, do this in bash:
7+
8+
```bash setup stackql-shell credentials-path=cicd/keys/testing/google-ro-credentials.json app-root-path=./test/tmp/.get-google-accel.stackql
9+
10+
export GOOGLE_CREDENTIALS="$(cat <credentials-path>)";
11+
12+
stackql shell --approot=<app-root-path>
13+
```
14+
15+
## Method
16+
17+
Do this in the `stackql` shell, replacing `<project>` with your GCP project name, and `<zone>` as desired, eg: `australia-southeast1-a`:
18+
19+
```sql stackql-shell input required project=stackql-demo zone=australia-southeast1-a
20+
21+
registry pull google;
22+
23+
select
24+
name,
25+
kind
26+
FROM google.compute.accelerator_types
27+
WHERE
28+
project = '<project>'
29+
AND zone = '<zone>'
30+
ORDER BY
31+
name desc
32+
;
33+
34+
```
35+
36+
## Result
37+
38+
39+
You will see something very much like this included in the output, presuming you have one VM (if you have zero, only the headers should appper, more VMs means more rows):
40+
41+
```sql expectation stdout-contains-all
42+
|---------------------|-------------------------|
43+
| name | kind |
44+
|---------------------|-------------------------|
45+
| nvidia-tesla-t4-vws | compute#acceleratorType |
46+
|---------------------|-------------------------|
47+
| nvidia-tesla-t4 | compute#acceleratorType |
48+
|---------------------|-------------------------|
49+
| nvidia-tesla-p4-vws | compute#acceleratorType |
50+
|---------------------|-------------------------|
51+
| nvidia-tesla-p4 | compute#acceleratorType |
52+
|---------------------|-------------------------|
53+
```
54+
55+
<!--- EXPECTATION
56+
google\ provider,\ version\ 'v24.11.00274'\ successfully\ installed
57+
goodbye
58+
-->
59+
60+
<x-expectation style="display: none;">
61+
<stdout-contains-nonempty-table></stdout-contains-nonempty-table>
62+
</x-expectation>
63+
64+
## Cleanup
65+
66+
```bash teardown best-effort app-root-path=./test/tmp/.get-google-accel.stackql
67+
68+
rm -rf <app-root-path>
69+
70+
```
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
## Setup
3+
4+
First, create a google service account key using the GCP Console, per [the GCP documentation](https://cloud.google.com/iam/docs/keys-create-delete). Grant the service account at least `Viewer` role equivalent privileges, per [the GCP dumentation](https://cloud.google.com/iam/docs/create-service-agents#grant-roles).
5+
6+
Then, do this in bash:
7+
8+
```bash setup stackql-shell credentials-path=cicd/keys/testing/google-ro-credentials.json app-root-path=./test/tmp/.get-google-vms.stackql
9+
10+
export GOOGLE_CREDENTIALS="$(cat <credentials-path>)";
11+
12+
stackql shell --approot=<app-root-path>
13+
```
14+
15+
## Method
16+
17+
Do this in the `stackql` shell, replacing `<project>` with your GCP project name, and `<zone>` as desired, eg: `australia-southeast1-a`:
18+
19+
```sql stackql-shell input required project=stackql-demo zone=australia-southeast1-a
20+
21+
registry pull google;
22+
23+
select
24+
name,
25+
id
26+
FROM google.compute.instances
27+
WHERE
28+
project = '<project>'
29+
AND zone = '<zone>'
30+
;
31+
32+
```
33+
34+
## Result
35+
36+
37+
You will see something very much like this included in the output, presuming you have one VM (if you have zero, only the headers should appper, more VMs means more rows):
38+
39+
```sql stackql stdout expectation stdout-table-contains-data
40+
|--------------------------------------------------|---------------------|
41+
| name | id |
42+
|--------------------------------------------------|---------------------|
43+
| any-compute-cluster-1-default-abcd-00000001-0001 | 1000000000000000001 |
44+
|--------------------------------------------------|---------------------|
45+
```
46+
47+
<!--- EXPECTATION
48+
google\ provider,\ version\ 'v24.11.00274'\ successfully\ installed
49+
goodbye
50+
-->
51+
52+
<x-expectation style="display: none;">
53+
<stdout-contains-nonempty-table></stdout-contains-nonempty-table>
54+
</x-expectation>
55+
56+
## Cleanup
57+
58+
```bash teardown best-effort app-root-path=./test/tmp/.get-google-vms.stackql
59+
60+
rm -rf <app-root-path>
61+
62+
```

docs/walkthroughs/list-aws-instances.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

internal/stackql/drm/prepared_statement_ctx.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,9 @@ type standardPreparedStatementCtx struct {
5353

5454
func (ps *standardPreparedStatementCtx) GetOrderedTccs() []internaldto.TxnControlCounters {
5555
var rv []internaldto.TxnControlCounters
56-
// absolute hack
57-
// TODO: fix all the counter logic
58-
keysRemaining := make(map[string]struct{})
59-
for k := range ps.aliasToTccMap {
60-
keysRemaining[k] = struct{}{}
61-
}
6256
for _, alias := range ps.aliasOrdering {
63-
delete(keysRemaining, alias)
6457
rv = append(rv, ps.aliasToTccMap[alias]...)
6558
}
66-
// if len(keysRemaining) == 1 {
67-
// for k := range keysRemaining {
68-
// rv = append(rv, ps.aliasToTccMap[k]...)
69-
// }
70-
// }
7159
return rv
7260
}
7361

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
|-------------------------|------------------------------------------|
2-
| bucket_name | domain_name |
2+
| BucketName | DomainName |
33
|-------------------------|------------------------------------------|
44
| stackql-trial-bucket-01 | stackql-trial-bucket-01.s3.amazonaws.com |
5-
|-------------------------|------------------------------------------|
5+
|-------------------------|------------------------------------------|

0 commit comments

Comments
 (0)