summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Sesti <33237525+sestinj@users.noreply.github.com>2023-08-23 14:44:33 -0700
committerGitHub <noreply@github.com>2023-08-23 14:44:33 -0700
commit0c563fc28fefa0cd7181fd78c579c3a86faaa4f9 (patch)
treeb67514fc49c7d19821d1a7f03579259b2948cc48
parentc5211c2cd69f368cc564aad155080957b754de19 (diff)
downloadsncontinue-0c563fc28fefa0cd7181fd78c579c3a86faaa4f9.tar.gz
sncontinue-0c563fc28fefa0cd7181fd78c579c3a86faaa4f9.tar.bz2
sncontinue-0c563fc28fefa0cd7181fd78c579c3a86faaa4f9.zip
Testing gh workflow (#401)
* testing * logging again * log home dir * build m1 script * correctly parse dates in history.tsx * logging * add redbaron to requirements.txt * tweaks before merging to main
-rw-r--r--.github/workflows/main.yaml8
-rw-r--r--Dockerfile22
-rw-r--r--buildm1.sh11
-rw-r--r--continuedev/requirements.txt3
-rw-r--r--continuedev/src/continuedev/core/context.py10
-rw-r--r--extension/package-lock.json4
-rw-r--r--extension/react-app/src/pages/history.tsx20
-rw-r--r--extension/src/activation/environmentSetup.ts1
-rw-r--r--run.m1.spec47
9 files changed, 113 insertions, 13 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 33d8ecd7..bbb85f9a 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -157,9 +157,15 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: continue-log
- path: ${{ env.HOME }}/.continue/continue.log
+ path: /home/runner/.continue/continue.log
if: always()
+ - name: Try to run linux binary
+ run: |
+ cd extension/server/exe
+ ./run
+ if: always() && matrix.os == 'ubuntu-20.04'
+
publish:
needs: test-and-package
runs-on: ubuntu-20.04
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..73eda76c
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,22 @@
+# A Dockerfile for quickly building and testing the pyinstaller binary
+
+FROM python:3.9
+
+# Set the working directory to /app
+
+WORKDIR /app
+
+# Copy the current directory contents into the container at /app
+
+COPY . /app
+
+# Install any needed packages specified in requirements.txt
+RUN pip install pyinstaller
+
+RUN pip install -r /app/continuedev/requirements.txt
+
+RUN pyinstaller run.spec
+
+RUN chmod +x /app/dist/run
+
+CMD ["/app/dist/run"]
diff --git a/buildm1.sh b/buildm1.sh
new file mode 100644
index 00000000..356026c0
--- /dev/null
+++ b/buildm1.sh
@@ -0,0 +1,11 @@
+
+#!/bin/sh
+
+# 1. Remove continuedev/.venv
+rm -rf continuedev/.venv
+
+# 2. Run pyinstaller run.m1.spec
+pyinstaller run.m1.spec
+
+# 3. Reinstall poetry deps
+cd continuedev && poetry install \ No newline at end of file
diff --git a/continuedev/requirements.txt b/continuedev/requirements.txt
index 8edcf70e..0cf909d5 100644
--- a/continuedev/requirements.txt
+++ b/continuedev/requirements.txt
@@ -21,4 +21,5 @@ meilisearch-python-async==1.4.8
socksio==1.0.0
ripgrepy==2.0.0
replicate==0.11.0
-bs4==0.0.1 \ No newline at end of file
+bs4==0.0.1
+redbaron==0.9.2 \ No newline at end of file
diff --git a/continuedev/src/continuedev/core/context.py b/continuedev/src/continuedev/core/context.py
index 326fb441..d47ad942 100644
--- a/continuedev/src/continuedev/core/context.py
+++ b/continuedev/src/continuedev/core/context.py
@@ -248,10 +248,12 @@ class ContextManager:
for item in context_items
]
async with Client("http://localhost:7700") as search_client:
- await asyncio.wait_for(
- search_client.index(SEARCH_INDEX_NAME).add_documents(documents),
- timeout=5,
- )
+
+ async def add_docs():
+ index = await search_client.get_index(SEARCH_INDEX_NAME)
+ await index.add_documents(documents)
+
+ await asyncio.wait_for(add_docs(), timeout=5)
@staticmethod
async def delete_documents(ids):
diff --git a/extension/package-lock.json b/extension/package-lock.json
index 7f4dab5f..802d96e5 100644
--- a/extension/package-lock.json
+++ b/extension/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "continue",
- "version": "0.0.321",
+ "version": "0.0.322",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
- "version": "0.0.321",
+ "version": "0.0.322",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
diff --git a/extension/react-app/src/pages/history.tsx b/extension/react-app/src/pages/history.tsx
index edf4d39f..2eb895b1 100644
--- a/extension/react-app/src/pages/history.tsx
+++ b/extension/react-app/src/pages/history.tsx
@@ -14,6 +14,14 @@ const Tr = styled.tr`
}
`;
+const parseDate = (date: string): Date => {
+ let dateObj = new Date(date);
+ if (isNaN(dateObj.getTime())) {
+ dateObj = new Date(parseInt(date) * 1000);
+ }
+ return dateObj;
+};
+
const TdDiv = styled.div`
cursor: pointer;
padding-left: 1rem;
@@ -46,6 +54,8 @@ function History() {
fetchSessions();
}, [client]);
+ console.log(sessions.map((session) => session.date_created));
+
return (
<div className="w-full">
<div className="items-center flex">
@@ -60,7 +70,11 @@ function History() {
<table className="w-full">
<tbody>
{sessions
- .sort((a, b) => parseInt(b.date_created) - parseInt(a.date_created))
+ .sort(
+ (a, b) =>
+ parseDate(b.date_created).getTime() -
+ parseDate(a.date_created).getTime()
+ )
.map((session, index) => (
<Tr key={index}>
<td>
@@ -72,9 +86,7 @@ function History() {
>
<div className="text-lg">{session.title}</div>
<div className="text-gray-400">
- {new Date(
- parseInt(session.date_created) * 1000
- ).toLocaleString("en-US", {
+ {parseDate(session.date_created).toLocaleString("en-US", {
weekday: "short",
year: "numeric",
month: "long",
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index fe0c8c0b..53ca8dc6 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -258,7 +258,6 @@ export async function startContinuePythonServer(redownload: boolean = true) {
};
const settings: any =
os.platform() === "win32" ? windowsSettings : macLinuxSettings;
-
// Spawn the server
const child = spawn(destination, settings);
diff --git a/run.m1.spec b/run.m1.spec
new file mode 100644
index 00000000..3eeea867
--- /dev/null
+++ b/run.m1.spec
@@ -0,0 +1,47 @@
+# -*- mode: python ; coding: utf-8 -*-
+import certifi
+
+block_cipher = None
+
+
+a = Analysis(
+ ['run.py'],
+ pathex=[],
+ binaries=[],
+ datas=[
+ ('continuedev', 'continuedev'),
+ (certifi.where(), 'ca_bundle')
+ ],
+ hiddenimports=['anthropic', 'github', 'ripgrepy', 'bs4', 'redbaron'],
+ hookspath=[],
+ hooksconfig={},
+ runtime_hooks=[],
+ excludes=['numpy', 'jedi'],
+ win_no_prefer_redirects=False,
+ win_private_assemblies=False,
+ cipher=block_cipher,
+ noarchive=False,
+)
+pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
+
+exe = EXE(
+ pyz,
+ a.scripts,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ [],
+ name='run',
+ debug=False,
+ bootloader_ignore_signals=False,
+ strip=False,
+ upx=True,
+ upx_exclude=[],
+ runtime_tmpdir=None,
+ console=True,
+ disable_windowed_traceback=False,
+ argv_emulation=False,
+ target_arch="arm64",
+ codesign_identity=None,
+ entitlements_file=None,
+)