diff --git a/README.md b/README.md index 8b997cdf..2f4b7713 100644 --- a/README.md +++ b/README.md @@ -88,16 +88,6 @@ TODO(jeremy): We should ask people try it out but first we need it to be working for people to try out. --> -## FAQ - -### Why not use the Jupyter Kernel? - -The Jupyter kernel creates a dependency on the python tool chain. If you aren't already using Python this can be a -hassle. Requiring a python environment is an unnecessary dependency if all we want to do is create a simple server to -execute shell commands. - -If users want to execute python code they can still do it by invoking `python` in the cell. - ## References 1. [VSCode Notebook API](https://code.visualstudio.com/api/extension-guides/notebook) diff --git a/docs/.github/dependabot.yml b/docs/.github/dependabot.yml new file mode 100644 index 00000000..573e2f0c --- /dev/null +++ b/docs/.github/dependabot.yml @@ -0,0 +1,14 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + time: '20:00' + open-pull-requests-limit: 10 +- package-ecosystem: bundler + directory: "/" + schedule: + interval: daily + time: '20:00' + open-pull-requests-limit: 10 diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..40b67f41 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,5 @@ +/public +resources/ +node_modules/ +package-lock.json +.hugo_build.lock \ No newline at end of file diff --git a/docs/.nvmrc b/docs/.nvmrc new file mode 100644 index 00000000..b009dfb9 --- /dev/null +++ b/docs/.nvmrc @@ -0,0 +1 @@ +lts/* diff --git a/docs/.vscode/settings.json b/docs/.vscode/settings.json new file mode 100644 index 00000000..1f027aaa --- /dev/null +++ b/docs/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [ + "Docsy", + "Goldydocs" + ] +} \ No newline at end of file diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..6f2b4856 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,10 @@ +# Docs For Foyle + +## To Add A Banner At the Top Of A Page use + + +```docsy +{{% pageinfo %}} +This is a placeholder page that shows you how to use this template site. +{{% /pageinfo %}} +``` \ No newline at end of file diff --git a/docs/assets/scss/_variables_project.scss b/docs/assets/scss/_variables_project.scss new file mode 100644 index 00000000..25690273 --- /dev/null +++ b/docs/assets/scss/_variables_project.scss @@ -0,0 +1,6 @@ +/* + +Add styles or override variables from the theme here. + +*/ + diff --git a/docs/config.yaml b/docs/config.yaml new file mode 100644 index 00000000..9070e384 --- /dev/null +++ b/docs/config.yaml @@ -0,0 +1,15 @@ +# THIS IS A TEST CONFIG ONLY! +# FOR THE CONFIGURATION OF YOUR SITE USE hugo.yaml. +# +# As of Docsy 0.7.0, Hugo 0.110.0 or later must be used. +# +# The sole purpose of this config file is to detect Hugo-module builds that use +# an older version of Hugo. +# +# DO NOT add any config parameters to this file. You can safely delete this file +# if your project is using the required Hugo version. + +module: + hugoVersion: + extended: true + min: 0.110.0 diff --git a/docs/content/en/_index.md b/docs/content/en/_index.md new file mode 100644 index 00000000..1ce11e91 --- /dev/null +++ b/docs/content/en/_index.md @@ -0,0 +1,34 @@ +--- +title: Foyle +--- + +{{< blocks/cover title="Foyle: An AI Assistant To Deploy and Operate Software!" image_anchor="top" height="full" >}} + + Learn More + + + Download + +

Use VSCode Notebooks To Interact With Foyle And Your Infrastructure!

+{{< blocks/link-down color="info" >}} +{{< /blocks/cover >}} + + +{{% blocks/lead color="primary" %}} +Foyle provides an AI powered assistant and literate environment to help you deploy and operate software. +{{% /blocks/lead %}} + + +{{% blocks/section color="dark" type="row" %}} + +{{% blocks/feature icon="fab fa-github" title="Contributions welcome!" url="https://github.com/jlewi/foyle" %}} +We do a [Pull Request](https://github.com/jlewi/foyle/pulls) contributions workflow on **GitHub**. New users are always welcome! +{{% /blocks/feature %}} + + +{{% blocks/feature icon="fab fa-twitter" title="Follow us on Twitter!" url="https://twitter.com/jeremylewi" %}} +For announcement of latest features etc. +{{% /blocks/feature %}} + + +{{% /blocks/section %}} diff --git a/docs/content/en/community/_index.md b/docs/content/en/community/_index.md new file mode 100644 index 00000000..3f237b8a --- /dev/null +++ b/docs/content/en/community/_index.md @@ -0,0 +1,6 @@ +--- +title: Community +menu: {main: {weight: 40}} +--- + + diff --git a/docs/content/en/docs/_index.md b/docs/content/en/docs/_index.md new file mode 100755 index 00000000..d17ac7de --- /dev/null +++ b/docs/content/en/docs/_index.md @@ -0,0 +1,7 @@ +--- +title: Documentation +linkTitle: Docs +menu: {main: {weight: 20}} +weight: 20 +--- + diff --git a/docs/content/en/docs/contribution-guidelines/_index.md b/docs/content/en/docs/contribution-guidelines/_index.md new file mode 100644 index 00000000..799678ff --- /dev/null +++ b/docs/content/en/docs/contribution-guidelines/_index.md @@ -0,0 +1,73 @@ +--- +title: Contribution Guidelines +weight: 10 +description: How to contribute to the docs +--- + +We use [Hugo](https://gohugo.io/) to format and generate our website, the +[Docsy](https://github.com/google/docsy) theme for styling and site structure, +and [Netlify](https://www.netlify.com/) to manage the deployment of the site. +Hugo is an open-source static site generator that provides us with templates, +content organisation in a standard directory structure, and a website generation +engine. You write the pages in Markdown (or HTML if you want), and Hugo wraps them up into a website. + +All submissions, including submissions by project members, require review. We +use GitHub pull requests for this purpose. Consult +[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more +information on using pull requests. + +## Quick start with Netlify + +Here's a quick guide to updating the docs. It assumes you're familiar with the +GitHub workflow and you're happy to use the automated preview of your doc +updates: + +1. Fork the [Foyle repo](https://github.com/jlewi/foyle) on GitHub. +1. Make your changes and send a pull request (PR). +1. If you're not yet ready for a review, add "WIP" to the PR name to indicate + it's a work in progress. (**Don't** add the Hugo property + "draft = true" to the page front matter, because that prevents the + auto-deployment of the content preview described in the next point.) +1. Wait for the automated PR workflow to do some checks. When it's ready, + you should see a comment like this: **deploy/netlify — Deploy preview ready!** +1. Click **Details** to the right of "Deploy preview ready" to see a preview + of your updates. +1. Continue updating your doc and pushing your changes until you're happy with + the content. +1. When you're ready for a review, add a comment to the PR, and remove any + "WIP" markers. + +## Updating a single page + +If you've just spotted something you'd like to change while using the docs, we have a shortcut for you: + +1. Click **Edit this page** in the top right hand corner of the page. +1. If you don't already have an up to date fork of the project repo, you are prompted to get one - click **Fork this repository and propose changes** or **Update your Fork** to get an up to date version of the project to edit. The appropriate page in your fork is displayed in edit mode. +1. Follow the rest of the [Quick start with Netlify](#quick-start-with-netlify) process above to make, preview, and propose your changes. + +## Previewing your changes locally + +If you want to run your own local Hugo server to preview your changes as you work: + +1. Follow the instructions in [Getting started](/docs/getting-started) to install Hugo and any other tools you need. You'll need at least **Hugo version 0.45** (we recommend using the most recent available version), and it must be the **extended** version, which supports SCSS. +1. Fork the [Foyle repo](https://github.com/jlewi/foyle) repo into your own project, then create a local copy using `git clone`. Don’t forget to use `--recurse-submodules` or you won’t pull down some of the code you need to generate a working site. + + ``` + git clone --recurse-submodules --depth 1 https://github.com/jlewi/foyle.git + ``` + +1. Run `hugo server` in the site root directory. By default your site will be available at http://localhost:1313/. Now that you're serving your site locally, Hugo will watch for changes to the content and automatically refresh your site. +1. Continue with the usual GitHub workflow to edit files, commit them, push the + changes up to your fork, and create a pull request. + +## Creating an issue + +If you've found a problem in the docs, but you're not sure how to fix it yourself, please create an issue in the [Foyle repo](https://github.com/jlewi/foyle/issues). You can also create an issue about a specific page by clicking the **Create Issue** button in the top right hand corner of the page. + +## Useful resources + +* [Docsy user guide](https://www.docsy.dev/docs/): All about Docsy, including how it manages navigation, look and feel, and multi-language support. +* [Hugo documentation](https://gohugo.io/documentation/): Comprehensive reference for Hugo. +* [Github Hello World!](https://guides.github.com/activities/hello-world/): A basic introduction to GitHub concepts and workflow. + + diff --git a/docs/content/en/docs/getting-started/_index.md b/docs/content/en/docs/getting-started/_index.md new file mode 100644 index 00000000..01d6363b --- /dev/null +++ b/docs/content/en/docs/getting-started/_index.md @@ -0,0 +1,93 @@ +--- +title: Getting Started +description: Getting started with Foyle? +weight: 2 +--- + +## Installation + +1. Download the latest release from the [releases page](https://github.com/jlewi/foyle/releases) + +## Setup + +1. Download the static assets for foyle + + ```bash + foyle assets download + ``` + + * This downloads the static assets for foyle. + * The assets are stored in `${HOME}/.foyle/assets`. + +1. Configure your OpenAPI key + + ``` + foyle config set openai.apiKeyFile=/path/to/openai/apikey + ``` + + * If you don't have a key, go to [OpenAI](https://openai.com/) to + obtain one + +1. Start the server + + ```bash + foyle serve + ``` + + * By default foyle uses port 8080 for the http server and port 9080 for gRPC + * If you need to use different ports you can configure this as follows + + ``` + foyle config set server.httpPort= + foyle config set server.grpcPort= + ``` +## Try it out! + +Now that foyle is running you can open up VSCode in your web browser and start interacting with foyle. + +1. Open up your browser and go to [http://localhost:8080/workbench](http://localhost:8080/workbench) +1. The first time you open the workbench you will be prompted to choose a theme as shown below. + + * Choose your theme and then click `mark done` + ![Choose Theme](choose_theme.png) +1. Open the explorer tab by clicking the icon in the left hand side navigation bar +1. Inside the explorer tab click the link to `add a folder` + + * Unfortunately **Open Folder** doesn't work reliably. [jlewi/foyle#21](https://github.com/jlewi/foyle/issues/21) + is tracking this. +1. This should open a file explorer and you should select the folder where you want your foyle notebooks to be + saved + * Your browser will likely prompt you to allow the site to access the file system; you need to allow this +1. You should now see the folder you selected in the explorer tab +1. Start a new notebook by clicking the `+` icon in the explorer tab +1. Give your notebook the ".foyle" extension + * Your notebook must have the ".foyle" extension so that vscode knows to open it using foyle +1. Click on your new notebook to open it inside VSCode's notebook editor +1. You can now add code and notebook cells like you normally would in vscode +1. To ask Foyle for help do one of the following + + * Open the command pallet and search for `Foyle generate a completion` + * Use the shortcut key: + * "win;" - on windows + * "cmd;" - on mac + +## Customizing Foyle VSCode Extension Settings + +### Customizing the server endpoints + +If you are running the Foyle server on a different port or address then you will need to change Foyle's VSCode settings. + +1. Open the settings panel; you can click the gear icon in the lower left window and then select settings +1. Search for `Foyle` +1. Set `Foyle-notebook: Agent-address` to the address of the Foyle server to use as the Agent + * The Agent handles requests to generate completions +1. Set `Foyle-notebook: Executor-address` to the address of the Foyle server to use as the Executor + * The Executor handles requests to execute commands + +### Customizing the keybindings + +If you are unhappy with the default key binding to generate a completion you can change it as follows + +1. Click the gear icon in the lower left window and then select "Keyboard shortcuts" +1. Search for "Foyle" +1. Change the keybinding for `Foyle: generate a completion` to the keybinding you want to use \ No newline at end of file diff --git a/docs/content/en/docs/getting-started/choose_theme.png b/docs/content/en/docs/getting-started/choose_theme.png new file mode 100644 index 00000000..5ff0535d Binary files /dev/null and b/docs/content/en/docs/getting-started/choose_theme.png differ diff --git a/docs/content/en/docs/overview/_index.md b/docs/content/en/docs/overview/_index.md new file mode 100644 index 00000000..62b48253 --- /dev/null +++ b/docs/content/en/docs/overview/_index.md @@ -0,0 +1,107 @@ +--- +title: Overview +weight: 1 +--- + +Foyle is a project aimed at building agents to help software developers +deploy and operate software. + +Foyle moves software operations out of the shell and into a literate +environment. Using Foyle, users + +* operate their infrastructure using VSCode Notebooks + * Foyle executes cells containing shell commands by using a simple API to execute them locally or remotely + (e.g. in a container) +* get help from AI's (ChatGPT, Claude, Bard, etc...) which add cells to the notebook + +Using VSCode Notebooks makes it easy for Foyle to learn from human feedback and get smarter over time. + +## What is Foyle? + +Foyle is a web application that runs locally. When you run Foyle you can open up a VSCode Notebook +in your browser. Using this notebook you can + +* Ask Foyle to assist you by adding cells to the notebook that contain markdown or commands to execute +* Execute the commands in the cells +* Ask Foyle to figure out what to do next based on the output of previous commands + +## Why use Foyle? + +* You are tired of copy/pasting commands from ChatGPT/Claude/Bard into your shell +* You want to move operations into a literate environment so you can easily capture the reasoning behind the commands you are executing +* You want to collect data to improve the AI's you are using to help you operate your infrastructure + +## Building Better Agents with Better Data + +The goal of foyle is to use this literate environment to collect two types of data +with the aim of building better agents + +1. Human feedback on agent suggestions +1. Human examples of reasoning traces + +### Human feedback + +We are all asking AI's (ChatGPT, Claude, Bard, etc...) to write commands to perform +operations. These AI's often make mistakes. This is especially true when the correct answer depends on internal knowledge which the AI doesn't have. + +Consider a simple example, lets ask ChatGPT + +``` +What's the gcloud logging command to fetch the logs for the hydros manifest named hydros? +``` + +ChatGPT responds with + +``` +gcloud logging read "resource.labels.manifest_name='hydros' AND logName='projects/YOUR_PROJECT_ID/logs/hydros'" +``` + +This is wrong; ChatGPT even suspects its likely to be wrong because it doesn't have any knowledge of the logging scheme used by [hydros](https://github.com/jlewi/hydros). +As users, we would most likely copy the command into our shell and iterate on it until we come up with the correct command; i.e + +``` +gcloud logging read 'jsonPayload."ManifestSync.Name"="hydros"' +``` + +This feedback is gold. We now have ground truth data `(prompt, human corrected answer)` that we could use to improve our AIs. Unfortunately, today's UX (copy and pasting into the shell) +means we are throwing this data away. + +The goal of foyle's literate environment is to create a UX that allows us to easily capture + +1. The original prompt +1. The AI provided answer +1. Any corrections the user makes. + +Foyle aims to continuously use this data to retrain the AI so that it gets better the more you use it. + +### Reasoning Traces + +Everyone is excited about the ability to build agents that can reason and perform complex tasks e.g. [Devin](https://www.cognition-labs.com/introducing-devin). +To build these agents we will need examples of reasoning traces that can be used to train the agent. This need is especially acute +when it comes to building agents that can work with our private, internal systems. + +Even when we start with the same tools (Kubernetes, GitHub Actions, Docker, Vercel, etc...), we end up adding tooling on top of that. +These can be simple scripts to encode things like naming conventions or they may be complex internal developer platforms. Either way, +agents need to be trained to understand these platforms if we want them to operate software on our behalf. + +Literate environments (e.g. [Datadog Notebooks](https://docs.datadoghq.com/notebooks/)) are great for routine operations and troubleshooting. +Using literate environments to operate infrastructure leads to a self documenting process that automatically captures + +1. Human thinking/analysis +1. Commands/operations executed +1. Command output + +Using literate environments provides a superior experience to copy/pasting commands and outputs into a GitHub issue/slack channel/Google Doc to +create a record of what happened. + +More importantly, the documents produced by literate environments contain essential information for training agents to operate our infrastructure. + + + +## Where should I go next? +* [Getting Started](/docs/getting-started/): Get started with $project +* [FAQ](/docs/reference/faq/): Frequently asked questions diff --git a/docs/content/en/docs/reference/_index.md b/docs/content/en/docs/reference/_index.md new file mode 100644 index 00000000..e414a427 --- /dev/null +++ b/docs/content/en/docs/reference/_index.md @@ -0,0 +1,12 @@ +--- +title: Reference +description: Low level reference docs for your project. +weight: 9 +--- + +{{% pageinfo %}} +This is a placeholder page that shows you how to use this template site. +{{% /pageinfo %}} + +If your project has an API, configuration, or other reference - anything that users need to look up that’s at an even lower level than a single task - put (or link to it) here. You can serve and link to generated reference docs created using Doxygen, +Javadoc, or other doc generation tools by putting them in your `static/` directory. Find out more in [Adding static content](https://docsy.dev/docs/adding-content/content/#adding-static-content). For OpenAPI reference, Docsy also provides a [Swagger UI layout and shortcode](https://www.docsy.dev/docs/adding-content/shortcodes/#swaggerui) that renders [Swagger UI](https://swagger.io/tools/swagger-ui/) using any OpenAPI YAML or JSON file as source. diff --git a/docs/content/en/docs/reference/faq.md b/docs/content/en/docs/reference/faq.md new file mode 100644 index 00000000..36301066 --- /dev/null +++ b/docs/content/en/docs/reference/faq.md @@ -0,0 +1,18 @@ +--- +title: FAQ +description: Frequently asked questions +weight: 9 +--- + +## Why not use the Jupyter Kernel? + +The Jupyter kernel creates a dependency on the python tool chain. If you aren't already using Python this can be a hassle. Requiring a python environment is an unnecessary dependency if all we want to do is create a simple server to execute shell commands. + +If users want to execute python code they can still do it by invoking `python` in the cell. + +## What are some related projects? + +* [cleric.io](https://cleric.io/) Company building a fully autonomous SRE teammate. +* [k8sgpt.ai](https://k8sgpt.ai/) Tool to scan your K8s clusters and explain issues and potential fixes. +* [Honeycomb Query Assitant](https://www.honeycomb.io/blog/introducing-query-assistant) +* [Fiberplane](https://docs.fiberplane.com/docs/notebooks) Offer collaborative notebooks for incidement management and post-mortems \ No newline at end of file diff --git a/docs/content/en/featured-background.jpg b/docs/content/en/featured-background.jpg new file mode 100644 index 00000000..5ae2dd49 Binary files /dev/null and b/docs/content/en/featured-background.jpg differ diff --git a/docs/content/en/search.md b/docs/content/en/search.md new file mode 100644 index 00000000..394feea5 --- /dev/null +++ b/docs/content/en/search.md @@ -0,0 +1,4 @@ +--- +title: Search Results +layout: search +--- diff --git a/docs/content/fileList.txt b/docs/content/fileList.txt new file mode 100644 index 00000000..e69de29b diff --git a/docs/docsy.work b/docs/docsy.work new file mode 100644 index 00000000..074dc2a1 --- /dev/null +++ b/docs/docsy.work @@ -0,0 +1,5 @@ +go 1.19 + +use . +use ../docsy/ // Local docsy clone resides in sibling folder to this project +// use ./themes/docsy/ // Local docsy clone resides in themes folder diff --git a/docs/docsy.work.sum b/docs/docsy.work.sum new file mode 100644 index 00000000..e69de29b diff --git a/docs/go.mod b/docs/go.mod new file mode 100644 index 00000000..37ec7449 --- /dev/null +++ b/docs/go.mod @@ -0,0 +1,5 @@ +module github.com/google/docsy-example + +go 1.12 + +require github.com/google/docsy v0.9.1 // indirect diff --git a/docs/go.sum b/docs/go.sum new file mode 100644 index 00000000..c11d56b0 --- /dev/null +++ b/docs/go.sum @@ -0,0 +1,5 @@ +github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= +github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984= +github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U= +github.com/twbs/bootstrap v5.2.3+incompatible h1:lOmsJx587qfF7/gE7Vv4FxEofegyJlEACeVV+Mt7cgc= +github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= diff --git a/docs/hugo.toml b/docs/hugo.toml new file mode 100644 index 00000000..344b3057 --- /dev/null +++ b/docs/hugo.toml @@ -0,0 +1,209 @@ +baseURL = "https://foyle.io/" +title = "Foyle" + +# Language settings +contentDir = "content/en" +defaultContentLanguage = "en" +defaultContentLanguageInSubdir = false +# Useful when translating. +enableMissingTranslationPlaceholders = true + +enableRobotsTXT = true + +# Will give values to .Lastmod etc. +enableGitInfo = true + +# Comment out to enable taxonomies in Docsy +# N.B. Turned this off on 2024/04/04. This added a list of tags in the right side panel that I didn't find that +disableKinds = ["taxonomy"] + +# You can add your own taxonomies +#[taxonomies] +#tag = "tags" +#category = "categories" + +[params.taxonomy] +# set taxonomyCloud = [] to hide taxonomy clouds +# useful +taxonomyCloud = [] +#taxonomyCloud = ["tags", "categories"] + +# If used, must have same length as taxonomyCloud +#taxonomyCloudTitle = ["Tag Cloud", "Categories"] + +# set taxonomyPageHeader = [] to hide taxonomies on the page headers +#taxonomyPageHeader = ["tags", "categories"] + + +# Highlighting config +pygmentsCodeFences = true +pygmentsUseClasses = false +# Use the new Chroma Go highlighter in Hugo. +pygmentsUseClassic = false +#pygmentsOptions = "linenos=table" +# See https://help.farbox.com/pygments.html +pygmentsStyle = "tango" + +# Configure how URLs look like per section. +[permalinks] +blog = "/:section/:year/:month/:day/:slug/" + +# Image processing configuration. +[imaging] +resampleFilter = "CatmullRom" +quality = 75 +anchor = "smart" + +# Language configuration + +[languages] +[languages.en] +languageName ="English" +# Weight used for sorting. +weight = 1 +[languages.en.params] +title = "Foyle" +description = "Foyle an AI assistant to deploy and operate software" + +[markup] + [markup.goldmark] + [markup.goldmark.parser.attribute] + block = true + [markup.goldmark.renderer] + unsafe = true + [markup.highlight] + # See a complete list of available styles at https://xyproto.github.io/splash/docs/all.html + style = "tango" + # Uncomment if you want your chosen highlight style used for code blocks without a specified language + # guessSyntax = "true" + +# Everything below this are Site Params + +# Comment out if you don't want the "print entire section" link enabled. +[outputs] +section = ["HTML", "print", "RSS"] + +[params] +privacy_policy = "https://foyle.io/privacy" + +# First one is picked as the Twitter card image if not set on page. +# images = ["images/project-illustration.png"] + +# Menu title if your navbar has a versions selector to access old versions of your site. +# This menu appears only if you have at least one [params.versions] set. +version_menu = "Releases" + +# Flag used in the "version-banner" partial to decide whether to display a +# banner on every page indicating that this is an archived version of the docs. +# Set this flag to "true" if you want to display the banner. +archived_version = false + +# The version number for the version of the docs represented in this doc set. +# Used in the "version-banner" partial to display a version number for the +# current doc set. +version = "0.0" + +# A link to latest version of the docs. Used in the "version-banner" partial to +# point people to the main doc site. +url_latest_version = "https://foyle.io" + +# Repository configuration (URLs for in-page links to opening issues and suggesting changes) +github_repo = "https://github.com/jlewi/foyle" +# An optional link to a related project repo. For example, the sibling repository where your product code lives. +github_project_repo = "https://github.com/jlewi/foyle" + +# Specify a value here if your content directory is not in your repo's root directory +github_subdir = "docs" + +# Uncomment this if your GitHub repo does not have "main" as the default branch, +# or specify a new value if you want to reference another branch in your GitHub links +github_branch= "main" + +# Google Custom Search Engine ID. Remove or comment out to disable search. +# TODO(jeremy): I should probably set this up. +# gcs_engine_id = "d72aa9b2712488cc3" + +# Enable Lunr.js offline search +offlineSearch = false + +# Enable syntax highlighting and copy buttons on code blocks with Prism +prism_syntax_highlighting = false + +[params.copyright] + authors = "Jeremy Lewi | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0) | " + from_year = 2024 + +# User interface configuration +[params.ui] +# Set to true to disable breadcrumb navigation. +breadcrumb_disable = false +# Set to false if you don't want to display a logo (/assets/icons/logo.svg) in the top navbar +navbar_logo = true +# Set to true if you don't want the top navbar to be translucent when over a `block/cover`, like on the homepage. +navbar_translucent_over_cover_disable = false +# Enable to show the side bar menu in its compact state. +sidebar_menu_compact = false +# Set to true to hide the sidebar search box (the top nav search box will still be displayed if search is enabled) +sidebar_search_disable = false + +# Adds a H2 section titled "Feedback" to the bottom of each doc. The responses are sent to Google Analytics as events. +# This feature depends on [services.googleAnalytics] and will be disabled if "services.googleAnalytics.id" is not set. +# If you want this feature, but occasionally need to remove the "Feedback" section from a single page, +# add "hide_feedback: true" to the page's front matter. +[params.ui.feedback] +enable = true +# The responses that the user sees after clicking "yes" (the page was helpful) or "no" (the page was not helpful). +yes = 'Glad to hear it! Please tell us how we can improve.' +no = 'Sorry to hear that. Please tell us how we can improve.' + +# Adds a reading time to the top of each doc. +# If you want this feature, but occasionally need to remove the Reading time from a single page, +# add "hide_readingtime: true" to the page's front matter +[params.ui.readingtime] +enable = false + +[params.links] +# End user relevant links. These will show up on left side of footer and in the community page if you have one. +#[[params.links.user]] +# name = "User mailing list" +# url = "https://example.org/mail" +# icon = "fa fa-envelope" +# desc = "Discussion and help from your fellow users" +#[[params.links.user]] +# name ="Twitter" +# url = "https://example.org/twitter" +# icon = "fab fa-twitter" +# desc = "Follow us on Twitter to get the latest news!" +#[[params.links.user]] +# name = "Stack Overflow" +# url = "https://example.org/stack" +# icon = "fab fa-stack-overflow" +# desc = "Practical questions and curated answers" +# Developer relevant links. These will show up on right side of footer and in the community page if you have one. +[[params.links.developer]] + name = "GitHub" + url = "https://github.com/jlewi/foyle" + icon = "fab fa-github" + desc = "Development takes place here!" +#[[params.links.developer]] +# name = "Slack" +# url = "https://example.org/slack" +# icon = "fab fa-slack" +# desc = "Chat with other project developers" +#[[params.links.developer]] +# name = "Developer mailing list" +# url = "https://example.org/mail" +# icon = "fa fa-envelope" +# desc = "Discuss development issues around the project" + +# hugo module configuration + +[module] + # Uncomment the next line to build and serve using local docsy clone declared in the named Hugo workspace: + # workspace = "docsy.work" + [module.hugoVersion] + extended = true + min = "0.110.0" + [[module.imports]] + path = "github.com/google/docsy" + disable = false diff --git a/docs/layouts/404.html b/docs/layouts/404.html new file mode 100644 index 00000000..1a9bd704 --- /dev/null +++ b/docs/layouts/404.html @@ -0,0 +1,7 @@ +{{ define "main" -}} +
+

Not found

+

Oops! This page doesn't exist. Try going back to the home page.

+

You can learn how to make a 404 page like this in Custom 404 Pages.

+
+{{- end }} diff --git a/docs/layouts/_default/_markup/render-heading.html b/docs/layouts/_default/_markup/render-heading.html new file mode 100644 index 00000000..7f8e9742 --- /dev/null +++ b/docs/layouts/_default/_markup/render-heading.html @@ -0,0 +1 @@ +{{ template "_default/_markup/td-render-heading.html" . }} diff --git a/docs/netlify.toml b/docs/netlify.toml new file mode 100644 index 00000000..e087db82 --- /dev/null +++ b/docs/netlify.toml @@ -0,0 +1,12 @@ +# Hugo build configuration for Netlify +# (https://gohugo.io/hosting-and-deployment/hosting-on-netlify/#configure-hugo-version-in-netlify) + +[build] +command = "npm run build:preview" +publish = "public" + +[build.environment] +GO_VERSION = "1.21.4" + +[context.production] +command = "npm run build:production" diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 00000000..ba6696a0 --- /dev/null +++ b/docs/package.json @@ -0,0 +1,42 @@ +{ + "name": "docsy-example-site", + "version": "0.9.1", + "version.next": "0.9.2-dev.0-unreleased", + "description": "Example site that uses Docsy theme for technical documentation.", + "repository": "github:google/docsy-example", + "homepage": "https://example.docsy.dev", + "author": "Docsy Authors", + "license": "Apache-2.0", + "bugs": "https://github.com/google/docsy-example/issues", + "spelling": "cSpell:ignore HTMLTEST precheck postbuild -", + "scripts": { + "_build": "npm run _hugo-dev --", + "_check:links": "echo IMPLEMENTATION PENDING for check-links; echo", + "_hugo": "hugo --cleanDestinationDir", + "_hugo-dev": "npm run _hugo -- -e dev -DFE", + "_local": "npx cross-env HUGO_MODULE_WORKSPACE=docsy.work", + "_serve": "npm run _hugo-dev -- --minify serve", + "build:preview": "npm run _hugo-dev -- --minify --baseURL \"${DEPLOY_PRIME_URL:-/}\"", + "build:production": "npm run _hugo -- --minify", + "build": "npm run _build -- ", + "check:links:all": "HTMLTEST_ARGS= npm run _check:links", + "check:links": "npm run _check:links", + "clean": "rm -Rf public/* resources", + "local": "npm run _local -- npm run", + "make:public": "git init -b main public", + "precheck:links:all": "npm run build", + "precheck:links": "npm run build", + "postbuild:preview": "npm run _check:links", + "postbuild:production": "npm run _check:links", + "serve": "npm run _serve", + "test": "npm run check:links", + "update:pkg:dep": "npm install --save-dev autoprefixer@latest postcss-cli@latest", + "update:pkg:hugo": "npm install --save-dev --save-exact hugo-extended@latest" + }, + "devDependencies": { + "autoprefixer": "^10.4.14", + "cross-env": "^7.0.3", + "hugo-extended": "0.124.1", + "postcss-cli": "^11.0.0" + } +}