Skip to content

Commit fc1ae58

Browse files
authored
Merge pull request #791 from jeff-phillips-18/remove-github-mode
Remove github mode from UI
2 parents a00e101 + f9c6638 commit fc1ae58

File tree

75 files changed

+269
-3458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+269
-3458
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
IL_UI_DEPLOYMENT=native
21
IL_UI_ADMIN_USERNAME=admin
32
IL_UI_ADMIN_PASSWORD=password
43

.env.github.example

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

docs/development.md

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ This is a [NextJS](https://nextjs.org) framework with [Patternfly](https://www.p
66

77
Podman is a requirement for using the Makefile. Install and init instructions [here](https://podman.io/docs/installation).
88

9-
Set the .env in the ui directory by copying the example env files in the root directory. The`IL_ENABLE_DEV_MODE` flag enables assistive features that help you automate the time consuming and repetitive tasks, such as filling skill and knowledge forms for testing. Once .env file is setup, run the following:
9+
Set the .env in the ui directory by copying the `example.env` file in the root directory. The`IL_ENABLE_DEV_MODE` flag enables assistive features that help you automate the time consuming and repetitive tasks, such as filling skill and knowledge forms for testing. Once .env file is setup, run the following:
1010

1111
```bash
12-
# Github mode development .env
13-
cp .env.github.example .env
14-
# or native mode .env
15-
cp .env.native.example .env
16-
1712
make start-dev-local
1813
```
1914

@@ -49,10 +44,7 @@ Choose the .env file to use and start the Next.js service with the following:
4944

5045
```bash
5146
cd ui/
52-
# Github mode development .env
53-
cp .env.github.example .env
54-
# or native mode .env
55-
cp .env.native.example .env
47+
cp .env.xample .env
5648
# start a development instance with hot module replacement on port 3000
5749
npm install
5850
npm run dev
@@ -83,27 +75,9 @@ npm run pretty
8375
npm run type-check
8476
```
8577

86-
UI stack supports two mode of deployments:
87-
88-
- github - This is the default mode and it allows users to push their knowledge and skill contribution to the github taxonomy repository.
89-
- native - This mode allow users to keep the skill and knowledge contribution in their local machine.
90-
91-
## Running the UI in Native Deployment Mode
92-
93-
To enable the native mode, set the `IL_UI_DEPLOYMENT=native` in the .env file. Once the flag is set, the UI will not push the knowledge and skill contribution to the github repository. Instead, it will keep the contribution in the local machine. In the `native` mode, the UI login page will show username and password input box to authenticate the user. You can setup the username and password in the .env file through the `IL_UI_ADMIN_USERNAME` and `IL_UI_ADMIN_PASSWORD` flags.
94-
95-
## Running the UI in Github Deployment Mode
96-
97-
To enable the github mode, set the `IL_UI_DEPLOYMENT=github` in the .env file. Once the flag is set, the UI will push the knowledge and skill contribution to the github taxonomy repository. In the `github` mode, the UI login page will show the github login button to authenticate the user.
98-
99-
### OAuth Configuration for Github Deployment Mode
100-
101-
You can either set up the Oauth app in your
102-
[GitHub](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app)
103-
account or use the user/pass defined in `.env`. To change those defaults, create
104-
the `/ui/.env` file and fill in the account user/pass with the following.
78+
## Running the UI
10579

106-
Example [.env](../.env.example) file.
80+
Contributions will be kept on the local machine. The UI login page will show username and password input box to authenticate the user. You can setup the username and password in the .env file through the `IL_UI_ADMIN_USERNAME` and `IL_UI_ADMIN_PASSWORD` flags.
10781

10882
## Local Dev Chat Environment
10983

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// src/pages/api/native/clone-repo.ts
1+
// src/pages/api/clone-repo.ts
22
import { NextResponse } from 'next/server';
33
import * as git from 'isomorphic-git';
44
import http from 'isomorphic-git/http/node';
@@ -15,8 +15,8 @@ export async function POST() {
1515
if (fs.existsSync(taxonomyDirectoryPath)) {
1616
const files = fs.readdirSync(taxonomyDirectoryPath);
1717
if (files.length > 0) {
18-
console.log(`Using existing native Taxonomy repository at ${taxonomyDirectoryPath}.`);
19-
return NextResponse.json({ message: `Using existing native Taxonomy repository at ${taxonomyDirectoryPath}.` }, { status: 200 });
18+
console.log(`Using existing Taxonomy repository at ${taxonomyDirectoryPath}.`);
19+
return NextResponse.json({ message: `Using existing Taxonomy repository at ${taxonomyDirectoryPath}.` }, { status: 200 });
2020
}
2121
fs.rmdirSync(taxonomyDirectoryPath, { recursive: true });
2222
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// src/app/api/native/download/route.ts
1+
// src/app/api/download/route.ts
22
'use server';
33
import { NextRequest, NextResponse } from 'next/server';
44
import { spawn } from 'child_process';

src/app/api/envConfig/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export async function GET() {
1414
MERLINITE_MODEL_NAME: process.env.IL_MERLINITE_MODEL_NAME || '',
1515
UPSTREAM_REPO_OWNER: process.env.NEXT_PUBLIC_TAXONOMY_REPO_OWNER || '',
1616
UPSTREAM_REPO_NAME: process.env.NEXT_PUBLIC_TAXONOMY_REPO || '',
17-
DEPLOYMENT_TYPE: process.env.IL_UI_DEPLOYMENT || '',
1817
ENABLE_DEV_MODE: process.env.IL_ENABLE_DEV_MODE || 'false',
1918
ENABLE_DOC_CONVERSION: process.env.IL_ENABLE_DOC_CONVERSION || 'false',
2019
ENABLE_SKILLS_FEATURES: process.env.IL_ENABLE_SKILLS_FEATURES || '',

src/app/api/fine-tune/git/branches/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// src/app/api/native/fine-tune/git/branches/route.ts
1+
// src/app/api/fine-tune/git/branches/route.ts
22
import { NextResponse } from 'next/server';
33
import * as git from 'isomorphic-git';
44
import fs from 'fs';
@@ -56,7 +56,7 @@ export async function GET() {
5656
// Sort by creation date, newest first
5757
branchDetails.sort((a, b) => b.creationDate - a.creationDate);
5858

59-
console.log('Total branches present in native taxonomy (fine-tune):', branchDetails.length);
59+
console.log('Total branches present in taxonomy (fine-tune):', branchDetails.length);
6060

6161
return NextResponse.json({ branches: branchDetails }, { status: 200 });
6262
} catch (error) {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// src/app/api/native/git/branches/route.ts
1+
// src/app/api/git/branches/route.ts
22
import { NextRequest, NextResponse } from 'next/server';
33
import * as git from 'isomorphic-git';
44
import fs from 'fs';
55
import path from 'path';
6-
import { findTaxonomyRepoPath } from '@/app/api/native/utils';
6+
import { findTaxonomyRepoPath } from '@/app/api/utils';
77

88
// Get the repository path from the environment variable
99
const LOCAL_TAXONOMY_ROOT_DIR = process.env.NEXT_PUBLIC_LOCAL_TAXONOMY_ROOT_DIR || `${process.env.HOME}/.instructlab-ui`;
@@ -52,7 +52,7 @@ export async function GET() {
5252
}
5353

5454
branchDetails.sort((a, b) => b.creationDate - a.creationDate); // Sort by creation date, newest first
55-
console.log('Total branches present in native taxonomy:', branchDetails.length);
55+
console.log('Total branches present in taxonomy:', branchDetails.length);
5656

5757
return NextResponse.json({ branches: branchDetails }, { status: 200 });
5858
} catch (error) {

src/app/api/github/download/route.ts

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

0 commit comments

Comments
 (0)