Skip to content

Commit

Permalink
Rename extension to 'Paver'
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <[email protected]>
  • Loading branch information
fbricon committed Nov 6, 2024
1 parent 18efbb9 commit ac0777d
Show file tree
Hide file tree
Showing 17 changed files with 167 additions and 91 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ name: CI
# Triggers the workflow on all pushes or pull requests on any branch
on:
push:
branches:
- '**'
branches:
- "**"
pull_request:
branches:
- '**'
branches:
- "**"

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest,windows-latest] # Define the operating systems for the matrix
os: [
macos-latest,
ubuntu-latest,
windows-latest,
] # Define the operating systems for the matrix

steps:
# Checkout code
Expand All @@ -36,7 +40,7 @@ jobs:
- name: Run build
run: npm run package

# Generate .vsix package for the extension
# Generate .vsix package for the extension
- name: Generate .vsix package
if: runner.os == 'Linux'
run: |
Expand All @@ -45,11 +49,11 @@ jobs:
# Upload VSIX artifact
- name: Upload VSIX artifact
if: runner.os == 'Linux'
if: runner.os == 'Linux'
uses: actions/upload-artifact@v4
with:
name: vscode-granite-vsix-${{ runner.os }}-${{ github.run_id }} # Unique name with OS and run ID
path: "./vscode-granite-*.vsix"
name: vscode-paver-vsix-${{ runner.os }}-${{ github.run_id }} # Unique name with OS and run ID
path: "./vscode-paver-*.vsix"

## Run tests
- name: Run Tests
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"

# Run install dependencies
- name: Install dependencies
Expand All @@ -89,17 +89,17 @@ jobs:
title: "${{ env.EXT_VERSION }}"
draft: true
files: |
vscode-granite-*.vsix
vscode-paver-*.vsix
- name: Publish to VS Code Marketplace
if: ${{ github.event_name == 'schedule' || inputs.publishToMarketPlace == 'true' || inputs.publishPreRelease == 'true' }}
run: |
npx @vscode/vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath vscode-granite-${{ env.EXT_VERSION }}.vsix
npx @vscode/vsce publish -p ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} --packagePath vscode-paver-${{ env.EXT_VERSION }}.vsix
- name: Publish to OpenVSX Registry
if: ${{ github.event_name == 'schedule' || inputs.publishToOVSX == 'true' || inputs.publishPreRelease == 'true' }}
run: |
npx ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath vscode-granite-${{ env.EXT_VERSION }}.vsix
npx ovsx publish -p ${{ secrets.OVSX_MARKETPLACE_TOKEN }} --packagePath vscode-paver-${{ env.EXT_VERSION }}.vsix
post-release-job:
if: ${{ inputs.publishToMarketPlace == 'true' && inputs.publishToOVSX == 'true' && inputs.EXTENSION_TAG == 'main' }}
Expand All @@ -111,11 +111,11 @@ jobs:
- name: Set Up NodeJS
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"
- name: Upversion for Development
run: |
tag=`npm version --no-git-tag-version patch`
git config --global user.email "[email protected]"
git config --global user.name "redhat-developer-bot"
git commit -am "Upversion to ${tag#v}"
git push origin
git push origin
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"preLaunchTask": "${defaultBuildTask}",
"env": {
"REDHAT_TELEMETRY_ENABLED": "true",
"GRANITE_EXT_DEV_MODE": "true"
"PAVER_EXT_DEV_MODE": "true"
}
},
{
Expand All @@ -35,7 +35,7 @@
"env": {
"REDHAT_TELEMETRY_ENABLED": "false",
"MOCK_OLLAMA": "true",
"GRANITE_EXT_DEV_MODE": "true"
"PAVER_EXT_DEV_MODE": "true"
}
}
]
Expand Down
6 changes: 5 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ out/test/**
# Ignore source code
src/**

# Ignore images from README, as the github repo images will be referenced instead
media/**

# Ignore all webview-ui files except the build directory
webviews/src/**
webviews/public/**
Expand All @@ -35,4 +38,5 @@ esbuild.js
node_modules/**
out/**
DCO
.github/**
.github/**
releng/**
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Change Log

All notable changes to the "vscode-granite" extension will be documented in this file.
All notable changes to the `Paver` extension will be documented in this file.

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
to structure this file.

## [Unreleased]

- Initial release
- Initial release
43 changes: 27 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
# How to Contribute

Contributions are essential for keeping this extension great. We try to keep it as easy as possible to contribute changes and we are open to suggestions for making it even easier. There are only a few guidelines that we need contributors to follow.
Contributions are essential for keeping this extension great. We try to keep it
as easy as possible to contribute changes and we are open to suggestions for
making it even easier. There are only a few guidelines that we need contributors
to follow.

## Development

### Installation Prerequisites:

* latest [Visual Studio Code](https://code.visualstudio.com/)
* [Node.js](https://nodejs.org/) v20.0.0 or higher
* optional: [gh](https://cli.github.com/) to manage pull requests.
- latest [Visual Studio Code](https://code.visualstudio.com/)
- [Node.js](https://nodejs.org/) v20.0.0 or higher
- optional: [gh](https://cli.github.com/) to manage pull requests.

### Steps

1. Fork and clone this repository

2. Change to the directory:

```bash
$ cd vscode-granite
$ cd vscode-paver
```

3. Install the NPM dependencies:

```bash
$ npm run install:ci
$ npm run install:ci
```
This will install the dependencies for the extension and its [webview(s)](https://code.visualstudio.com/api/extension-guides/webview)

This will install the dependencies for the extension and its
[webview(s)](https://code.visualstudio.com/api/extension-guides/webview)

4. To run the extension, open the Debugging tab in VSCode.

Expand All @@ -30,14 +39,15 @@ This will install the dependencies for the extension and its [webview(s)](https:
### Build the extension

You can package the extension as a *.vsix archive:
```bash
$ npx @vscode/vsce package
```

It will generate a vscode-granite-`<version>`.vsix
```bash
$ npx @vscode/vsce package
```

You can then install it in VS Code by following these [instructions](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).
It will generate a vscode-paver-`<version>`.vsix

You can then install it in VS Code by following these
[instructions](https://code.visualstudio.com/docs/editor/extension-marketplace#_install-from-a-vsix).

## Contribute changes

Expand All @@ -51,12 +61,13 @@ Try to follow this workflow to contribute changes:
6. Open a pull request with a detailed description of your changes

With regards to git history, please:

- keep the git history linear, no merge commits.
- ensure PRs are squashed before merging, to keep changes atomic.

### Certificate of Origin

By contributing to this project you agree to the Developer Certificate of
Origin (DCO). This document was created by the Linux Kernel community and is a
simple statement that you, as a contributor, have the legal right to make the
contribution. See the [DCO](DCO) file for details.
By contributing to this project you agree to the Developer Certificate of Origin
(DCO). This document was created by the Linux Kernel community and is a simple
statement that you, as a contributor, have the legal right to make the
contribution. See the [DCO](DCO) file for details.
97 changes: 73 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Granite Code Assistant
# Paver

`Granite Code Assistant` simplifies the setup of the [Continue extension](https://marketplace.visualstudio.com/items?itemName=Continue.continue) to integrate [IBM](https://www.ibm.com/)'s [Granite code models](https://github.com/ibm-granite/granite-code-models), as your code assistant in Visual Studio Code, using [Ollama](https://ollama.com/) as the runtime environment.
`Paver` simplifies the setup of the
[Continue extension](https://marketplace.visualstudio.com/items?itemName=Continue.continue)
to integrate [IBM](https://www.ibm.com/)'s
[Granite code models](https://github.com/ibm-granite/granite-code-models), as
your code assistant in Visual Studio Code, using [Ollama](https://ollama.com/)
as the runtime environment.

By leveraging Granite code models and open-source components such as Ollama and Continue, you can write, generate, explain, or document code with full control over your data, ensuring it stays private and secure on your machine.
By leveraging Granite code models and open-source components such as Ollama and
Continue, you can write, generate, explain, or document code with full control
over your data, ensuring it stays private and secure on your machine.

## Getting Started

This project features an intuitive UI, designed to simplify the installation and management of Ollama and Granite Code models. The first time the extension starts, a setup wizard is automatically launched to guide you through the installation process.
This project features an intuitive UI, designed to simplify the installation and
management of Ollama and Granite Code models. The first time the extension
starts, a setup wizard is automatically launched to guide you through the
installation process.

You can later open the setup wizard anytime from the command palette by executing the *"Granite: Setup Granite Code as code assistant"* command.
You can later open the setup wizard anytime from the command palette by
executing the _"Paver: Setup Granite Code as code assistant"_ command.

### Installation Prerequisites

Expand All @@ -18,68 +29,106 @@ You can later open the setup wizard anytime from the command palette by executin

### Step 1: Install the Extension

Open Visual Studio Code, navigate to the Extensions tab on the left sidebar, select "vscode-granite," and click "install."
Open Visual Studio Code, navigate to the Extensions tab on the left sidebar,
select "Paver," and click "install."

The [Continue.dev](https://continue.dev/) extension will be automatically added as a dependency, if not already installed. If you installed `Granite Code Assistant` manually, you may need to also install the Continue extension separately.
The [Continue.dev](https://continue.dev/) extension will be automatically added
as a dependency, if not already installed. If you installed `Paver` manually,
you may need to also install the Continue extension separately.

### Step 2: Install Ollama

Once the extension is running, the setup wizard will prompt you to install Ollama.
Once the extension is running, the setup wizard will prompt you to install
Ollama.

The following Ollama installation options are available :

1. **Install with Homebrew:** If Homebrew is detected on your machine (Mac/Linux).
1. **Install with Homebrew:** If Homebrew is detected on your machine
(Mac/Linux).
2. **Install with Script:** Available on Linux.
3. **Install Manually:** Supported on all platforms. If you choose this option, you will be redirected to the official [Ollama download page](https://ollama.com/download) to complete the installation.
3. **Install automatically:** Available on Windows, will perform a silent
installation using sensible defaults.
4. **Install Manually:** Supported on all platforms. If you choose this option,
you will be redirected to the official
[Ollama download page](https://ollama.com/download) to complete the
installation.

Once Ollama is installed, the page will refresh automatically. Depending on the security settings of your plateform, you may need to start Ollama manually the first time.
Once Ollama is installed, the page will refresh automatically. Depending on the
security settings of your plateform, you may need to start Ollama manually the
first time.

![installollama](media/installollama.gif)

### Step 3: Install Granite Models

Select the Granite model(s) you wish to install and follow the on-screen instructions to complete the setup.
Select the Granite model(s) you wish to install and follow the on-screen
instructions to complete the setup.

![installmodels](media/installmodels.gif)

After the models are pulled into Ollama, Continue will be configured automatically to use them, and the Continue chat view will open, allowing you to interact with the models via the UI or tab completion.
After the models are pulled into Ollama, Continue will be configured
automatically to use them, and the Continue chat view will open, allowing you to
interact with the models via the UI or tab completion.

## About the Stack

### IBM Granite Code Models

The Granite Code models are optimized for enterprise software development workflows, performing well across various coding tasks (e.g., code generation, fixing, and explanation). They are versatile "all-around" code models.
The Granite Code models are optimized for enterprise software development
workflows, performing well across various coding tasks (e.g., code generation,
fixing, and explanation). They are versatile "all-around" code models.

Granite Code comes in various sizes to fit your workstation's resources. Generally, larger models yield better results but require more disk space, memory, and processing power.
Granite Code comes in various sizes to fit your workstation's resources.
Generally, larger models yield better results but require more disk space,
memory, and processing power.

**Recommendation:** Use Model Size 8B for chat and 8B for tab code completion.

For more details, refer to [Granite Code Models](https://github.com/ibm-granite/granite-code-models).
For more details, refer to
[Granite Code Models](https://github.com/ibm-granite/granite-code-models).

### Ollama

Many corporations have privacy regulations that prohibit sending internal code or data to third-party services. Running LLMs locally allows you to sidestep these restrictions and ensures no sensitive information is sent to a remote service. Ollama is one of the simplest and most popular open-source solutions for running LLMs locally.
Many corporations have privacy regulations that prohibit sending internal code
or data to third-party services. Running LLMs locally allows you to sidestep
these restrictions and ensures no sensitive information is sent to a remote
service. Ollama is one of the simplest and most popular open-source solutions
for running LLMs locally.

### Continue.dev

[Continue](https://docs.continue.dev) is the leading open-source AI code assistant. You can connect any models and contexts to build custom autocomplete and chat experiences inside [VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue) and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension).
[Continue](https://docs.continue.dev) is the leading open-source AI code
assistant. You can connect any models and contexts to build custom autocomplete
and chat experiences inside
[VS Code](https://marketplace.visualstudio.com/items?itemName=Continue.continue)
and [JetBrains](https://plugins.jetbrains.com/plugin/22707-continue-extension).

- Easily understand code sections
- Tab to autocomplete code suggestions
- Refactor functions while coding
- Ask questions about your codebase
- Quickly use documentation as context

For more details, refer to [continue.dev](https://github.com/continuedev/continue).

For more details, refer to
[continue.dev](https://github.com/continuedev/continue).

### How to Contribute to this Project?

Please check our [Guidelines](https://github.com/redhat-developer/vscode-granite/blob/main/CONTRIBUTING.md) to contribute to our project.

Please check our
[Guidelines](https://github.com/redhat-developer/vscode-paver/blob/main/CONTRIBUTING.md)
to contribute to our project.

### License

This project is licensed under Apache 2.0. See [LICENSE](LICENSE) for more information.
This project is licensed under Apache 2.0. See [LICENSE](LICENSE) for more
information.

### Telemetry

With your approval, the vscode-granite extension collects anonymous [usage data](USAGE_DATA.md) and sends it to Red Hat servers to help improve our products and services. Read our [privacy statement](https://developers.redhat.com/article/tool-data-collection) to learn more. This extension respects the `redhat.telemetry.enabled` setting, which you can learn more about at [Red Hat Telemetry](https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting).
With your approval, the Paver extension collects anonymous
[usage data](USAGE_DATA.md) and sends it to Red Hat servers to help improve our
products and services. Read our
[privacy statement](https://developers.redhat.com/article/tool-data-collection)
to learn more. This extension respects the `redhat.telemetry.enabled` setting,
which you can learn more about at
[Red Hat Telemetry](https://github.com/redhat-developer/vscode-redhat-telemetry#how-to-disable-telemetry-reporting).
Loading

0 comments on commit ac0777d

Please sign in to comment.