Skip to content

Commit

Permalink
Comment out changes to try to see why execution in non-interactive ce…
Browse files Browse the repository at this point in the history
…lls is no longer working.
  • Loading branch information
jlewi committed Oct 19, 2024
1 parent fee5aa1 commit 2d650a6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 14 deletions.
27 changes: 26 additions & 1 deletion examples/test_execute.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
```sh
* Why can't my pod access GCS?
* Is workload identity properly configured
* It uses the default service account

```bash
for i in {0..100}
do
echo Loop Iter $i
sleep 1
done
```

```bash {"id":"01JAH0T4B4KPSKKYAFPA5XW56C","interactive":"false"}
# 1. Verify the annotations on the Kubernetes service account to ensure it's linked to the correct Google Cloud service account
kubectl get serviceaccount default -o yaml

# 2. Check the IAM roles assigned to your Google Cloud service account
gcloud iam service-accounts get-iam-policy <SERVICE_ACCOUNT_EMAIL>
```

```bash {"id":"01JAH0QZWEW7057D79ZY7S266M","interactive":"false"}
# 1. Verify Workload Identity is enabled on your GKE cluster
gcloud container clusters describe dev --region=us-west1 --format="value(workloadIdentityConfig)"

# 2. Check if the Kubernetes service account is annotated with the correct IAM service account
#kubectl get namespace

```

```bash {"interactive":"true"}
kubectl get serviceaccount default -o yaml
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "runme",
"version": "3.9.0",
"version": "3.10.0-jlewi",
"publisher": "stateful",
"displayName": "Runme Notebooks for DevOps",
"description": "Notebooks for DevOps written in Markdown. Runnable, configurable commands/code and embedded terminals. Integrated with cloud consoles, containers and pipelines.",
Expand Down
16 changes: 9 additions & 7 deletions src/extension/ai/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
LogEventsRequest,
LogEventType,
LogEvent,
StreamGenerateRequest_Trigger,
//StreamGenerateRequest_Trigger,
} from '@buf/jlewi_foyle.bufbuild_es/foyle/v1alpha1/agent_pb'
import * as vscode from 'vscode'
import { ulid } from 'ulidx'
Expand Down Expand Up @@ -63,13 +63,15 @@ export class EventReporter implements IEventReporter {
event.cells = cells
event.contextId = SessionManager.getManager().getID()

// TODO(jeremy): Do we need this? Is it causing problems with trying
// to modify resolve?
// Fire an event to trigger the AI service
const cellChangeEvent = new stream.CellChangeEvent(
cell.notebook.uri.toString(),
cell.index,
StreamGenerateRequest_Trigger.CELL_EXECUTE,
)
this.streamCreator.handleEvent(cellChangeEvent)
// const cellChangeEvent = new stream.CellChangeEvent(
// cell.notebook.uri.toString(),
// cell.index,
// StreamGenerateRequest_Trigger.CELL_EXECUTE,
// )
// this.streamCreator.handleEvent(cellChangeEvent)
return this.reportEvents([event])
}

Expand Down
10 changes: 5 additions & 5 deletions src/extension/ai/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ export class AIManager {
vscode.window.onDidChangeActiveTextEditor(cellGenerator.handleOnDidChangeActiveTextEditor),
)

this.subscriptions.push(
vscode.workspace.onDidChangeNotebookDocument(
eventGenerator.handleOnDidChangeNotebookDocument,
),
)
// this.subscriptions.push(
// vscode.workspace.onDidChangeNotebookDocument(
// eventGenerator.handleOnDidChangeNotebookDocument,
// ),
// )
}

// Cleanup method. We will use this to clean up any resources when extension is closed.
Expand Down

0 comments on commit 2d650a6

Please sign in to comment.