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
This commit is contained in:
Nate Sesti 2023-08-23 14:44:33 -07:00 • committed by GitHub
parent c5211c2cd6
commit 0c563fc28f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 113 additions and 13 deletions

View file

@ -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

22
Dockerfile Normal file
View file

@ -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"]

11
buildm1.sh Normal file
View file

@ -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

View file

@ -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
bs4==0.0.1
redbaron==0.9.2

View file

@ -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):

View file

@ -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",

View file

@ -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",

View file

@ -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);

47
run.m1.spec Normal file
View file

@ -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,
)