Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
binary-bob
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AI
binary-bob
Commits
2803148f
Commit
2803148f
authored
11 months ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
errors & cron
parent
f71216f1
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Dockerfile
+1
-1
1 addition, 1 deletion
Dockerfile
compose.yaml
+2
-1
2 additions, 1 deletion
compose.yaml
cron
+0
-1
0 additions, 1 deletion
cron
src/index.ts
+9
-5
9 additions, 5 deletions
src/index.ts
src/tasks/ingest.ts
+2
-0
2 additions, 0 deletions
src/tasks/ingest.ts
with
14 additions
and
8 deletions
Dockerfile
+
1
−
1
View file @
2803148f
...
@@ -16,9 +16,9 @@ RUN apt-get update \
...
@@ -16,9 +16,9 @@ RUN apt-get update \
WORKDIR
/app
WORKDIR
/app
COPY
. /app/
COPY
. /app/
COPY
cron /etc/cron.d/tasks_cronjob
RUN
npm
install
RUN
npm
install
RUN
npm run build
RUN
npm run build
RUN
sh
-c
'echo "0 4 * * 0 cd /app && npm run ingest >> /var/log/binary-bob-ingest.log 2>&1" > /etc/cron/tasks_cronjob'
# CMD ["npm", "start"]
# CMD ["npm", "start"]
CMD
["/bin/bash", "-c", "chmod 644 /etc/cron.d/tasks_cronjob && cron && cd /app && npm start"]
CMD
["/bin/bash", "-c", "chmod 644 /etc/cron.d/tasks_cronjob && cron && cd /app && npm start"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
compose.yaml
+
2
−
1
View file @
2803148f
services
:
services
:
qdrant
:
qdrant
:
# image: qdrant/qdrant
build
:
build
:
context
:
.
context
:
.
dockerfile_inline
:
|
dockerfile_inline
:
|
...
@@ -12,6 +11,7 @@ services:
...
@@ -12,6 +11,7 @@ services:
-
./data/qdrant/storage:/qdrant/storage
-
./data/qdrant/storage:/qdrant/storage
-
./data/qdrant/snapshots:/qdrant/snapshots
-
./data/qdrant/snapshots:/qdrant/snapshots
-
./conf/qdrant/config.yaml:/qdrant/config/config.yaml
-
./conf/qdrant/config.yaml:/qdrant/config/config.yaml
restart
:
unless-stopped
healthcheck
:
healthcheck
:
test
:
curl -s http://localhost:6333/healthz | grep -q 'healthz check passed' || exit
1
test
:
curl -s http://localhost:6333/healthz | grep -q 'healthz check passed' || exit
1
interval
:
1m
interval
:
1m
...
@@ -28,4 +28,5 @@ services:
...
@@ -28,4 +28,5 @@ services:
-
./data/binary-bob:/app/data
-
./data/binary-bob:/app/data
ports
:
ports
:
-
3000:3000
-
3000:3000
restart
:
unless-stopped
\ No newline at end of file
This diff is collapsed.
Click to expand it.
cron
deleted
100644 → 0
+
0
−
1
View file @
f71216f1
0 4 * * 0 cd /app && npm run ingest
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/index.ts
+
9
−
5
View file @
2803148f
...
@@ -8,12 +8,16 @@ app.use(bodyParser.urlencoded({ extended: false }));
...
@@ -8,12 +8,16 @@ app.use(bodyParser.urlencoded({ extended: false }));
app
.
use
(
bodyParser
.
json
());
app
.
use
(
bodyParser
.
json
());
app
.
get
(
'
/query/:query
'
,
async
(
req
:
Request
,
res
:
Response
)
=>
{
app
.
get
(
'
/query/:query
'
,
async
(
req
:
Request
,
res
:
Response
)
=>
{
try
{
const
answer
=
await
queryAgent
({
query
:
req
.
params
.
query
});
const
answer
=
await
queryAgent
({
query
:
req
.
params
.
query
});
if
(
answer
===
undefined
)
{
if
(
answer
===
undefined
)
{
res
.
sendStatus
(
404
);
res
.
sendStatus
(
404
);
}
else
{
}
else
{
res
.
json
(
answer
);
res
.
json
(
answer
);
}
}
}
catch
(
err
)
{
console
.
error
(
'
Error on query
'
,
req
.
params
.
query
,
err
);
}
});
});
app
.
get
(
'
/
'
,
(
req
:
Request
,
res
:
Response
)
=>
{
app
.
get
(
'
/
'
,
(
req
:
Request
,
res
:
Response
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/tasks/ingest.ts
+
2
−
0
View file @
2803148f
...
@@ -12,5 +12,7 @@ async function ingest(): Promise<void> {
...
@@ -12,5 +12,7 @@ async function ingest(): Promise<void> {
}
}
(
async
()
=>
{
(
async
()
=>
{
console
.
info
(
'
Starting ingest
'
);
await
ingest
();
await
ingest
();
console
.
info
(
'
Ingest complete
'
);
})();
})();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment