Skip to content
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

Added firebase emulator instructions #100

Merged
merged 8 commits into from
May 13, 2024
Merged

Added firebase emulator instructions #100

merged 8 commits into from
May 13, 2024

Conversation

pavelgj
Copy link
Collaborator

@pavelgj pavelgj commented May 9, 2024

No description provided.

Copy link
Contributor

@peterfriese peterfriese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made some changes (more required), and left some questions.

docs/firebase.md Outdated Show resolved Hide resolved
docs/firebase.md Outdated Show resolved Hide resolved
To use Genkit with Firebase emulator start the emulator like this:

```bash
GENKIT_ENV=dev firebase emulators:start --inspect-functions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sufficient? I've got the following:

"serve-genkit": "npm run build && GENKIT_ENV=dev GENKIT_REFLECTION_ON_STARTUP_FAILURE=ignore firebase emulators:start --inspect-functions"

I haven't tried which is the absolute essential number of parameters to make it work...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We made a few changes, GENKIT_REFLECTION_ON_STARTUP_FAILURE is not necessary now.

To launch the Genkit Dev UI that talks to your code running inside the Firebase Emulator run this command:

```bash
genkit start --attach http://localhost:3100 --port 4001
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have

"genkit-emulator": "GCLOUD_PROJECT=fir-genkit-fundamental-01 && genkit start --attach http://localhost:3100 --port 4444",

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In attach mode runtime env var (e.g. GCLOUD_PROJECT) are not required.

docs/firebase.md Outdated
genkit start --attach http://localhost:3100 --port 4001
```

To see traces from Firestore in the Dev UI you can navigate to the Inspect tab and toggle the "Dev/Prod" switch. When toggled to "prod" it will be loading traces from firestore.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which Firestore instance, exactly, will the traces be fetched from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That depends... if you have firestore emulator configured then it will pull from emulated firestore, if not then from prod.

pavelgj and others added 2 commits May 10, 2024 11:39
Co-authored-by: Peter Friese <[email protected]>
Co-authored-by: Peter Friese <[email protected]>
@pavelgj pavelgj requested a review from peterfriese May 13, 2024 17:50
docs/firebase.md Outdated Show resolved Hide resolved
docs/firebase.md Outdated Show resolved Hide resolved
docs/firebase.md Outdated Show resolved Hide resolved
pavelgj and others added 3 commits May 13, 2024 16:38
Co-authored-by: Kevin Cheung <[email protected]>
Co-authored-by: Kevin Cheung <[email protected]>
Co-authored-by: Kevin Cheung <[email protected]>
docs/firebase.md Outdated Show resolved Hide resolved
@pavelgj pavelgj merged commit 5d71e50 into main May 13, 2024
3 of 4 checks passed
@pavelgj pavelgj deleted the pavelgj/emulatordocs branch May 13, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants