Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
hivemind
Commits
81a6eb7b
Commit
81a6eb7b
authored
11 months ago
by
Michal Zander
Committed by
Michał Kudela
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add postgrest setup
parent
a9b0df17
No related branches found
No related tags found
2 merge requests
!827
Merge develop changes to master
,
!717
Rewrite python function to sql ( condenser_api )
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+13
-1
13 additions, 1 deletion
Dockerfile
postgrest.conf
+7
-0
7 additions, 0 deletions
postgrest.conf
scripts/ci/start_postgrest.sh
+60
-0
60 additions, 0 deletions
scripts/ci/start_postgrest.sh
with
80 additions
and
1 deletion
Dockerfile
+
13
−
1
View file @
81a6eb7b
...
...
@@ -2,6 +2,10 @@
# Base docker file having defined environment for build and run of a Hivemind instance.
# Use scripts/ci/build_ci_base_image.sh to build a new version of the CI base image. It must be properly tagged and pushed to the container registry.
ARG
POSTGREST_VERSION=v12.0.2
FROM
postgrest/postgrest:${POSTGREST_VERSION}
AS
pure_postgrest
FROM
--platform=$BUILDPLATFORM python:3.8-slim
as
runtime
ARG
TARGETPLATFORM
...
...
@@ -96,12 +100,19 @@ ARG HTTP_PORT=8080
ENV
HTTP_PORT=${HTTP_PORT}
# Lets use by default host address from default docker bridge network
ARG
POSTGRES_URL="postgresql://hivemind@
172.17.0.1
/haf_block_log"
ARG
POSTGRES_URL="postgresql://hivemind@
haf-instance:5432
/haf_block_log"
ENV
POSTGRES_URL=${POSTGRES_URL}
ARG
POSTGRES_ADMIN_URL="postgresql://haf_admin@172.17.0.1:5432/haf_block_log"
ENV
POSTGRES_ADMIN_URL=${POSTGRES_ADMIN_URL}
ARG
USE_POSTGREST=1
ENV
USE_POSTGREST=${USE_POSTGREST}
ENV
PGRST_DB_SCHEMA="hivemind_endpoints"
ENV
PGRST_DB_ANON_ROLE="hivemind"
ENV
PGRST_DB_ROOT_SPEC="home"
ENV
LANG=en_US.UTF-8
USER
hivemind
...
...
@@ -109,6 +120,7 @@ WORKDIR /home/hivemind
SHELL
["/bin/bash", "-c"]
COPY
--chmod=755 --from=pure_postgrest /bin/postgrest /usr/local/bin
COPY
--from=builder --chown=hivemind:hivemind /home/hivemind/app/dist /home/hivemind/dist
COPY
--from=builder --chown=hivemind:hivemind /home/hivemind/.hivemind-venv /home/hivemind/.hivemind-venv
COPY
--from=builder --chown=hivemind:hivemind /home/hivemind/app/docker/docker_entrypoint.sh .
...
...
This diff is collapsed.
Click to expand it.
postgrest.conf
0 → 100644
+
7
−
0
View file @
81a6eb7b
db
-
uri
=
"postgres://haf_admin@/haf_block_log"
db
-
schema
=
"hivemind_endpoints"
db
-
anon
-
role
=
"hivemind"
db
-
pool
=
20
db
-
pool
-
acquisition
-
timeout
=
10
server
-
port
=
3000
admin
-
server
-
port
=
3001
\ No newline at end of file
This diff is collapsed.
Click to expand it.
scripts/ci/start_postgrest.sh
0 → 100755
+
60
−
0
View file @
81a6eb7b
#!/bin/bash
set
-e
set
-o
pipefail
POSTGRES_HOST
=
"localhost"
POSTGRES_PORT
=
5432
POSTGRES_USER
=
"hivemind"
WEBSERVER_PORT
=
8080
ADMIN_PORT
=
3001
while
[
$#
-gt
0
]
;
do
case
"
$1
"
in
--host
=
*
)
POSTGRES_HOST
=
"
${
1
#*=
}
"
;;
--port
=
*
)
POSTGRES_PORT
=
"
${
1
#*=
}
"
;;
--user
=
*
)
POSTGRES_USER
=
"
${
1
#*=
}
"
;;
--webserver_port
|
--webserver-port
=
*
)
WEBSERVER_PORT
=
"
${
1
#*=
}
"
;;
--admin_port
|
--admin-port
=
*
)
ADMIN_PORT
=
"
${
1
#*=
}
"
;;
--postgres-url
=
*
)
POSTGRES_URL
=
"
${
1
#*=
}
"
;;
-
*
)
echo
"ERROR: '
$1
' is not a valid option"
echo
exit
1
;;
*
)
echo
"ERROR: '
$1
' is not a valid argument"
echo
exit
2
;;
esac
shift
done
POSTGRES_ACCESS
=
${
POSTGRES_URL
:-
"postgresql://
$POSTGRES_USER
@
$POSTGRES_HOST
:
$POSTGRES_PORT
/haf_block_log"
}
start_webserver
()
{
export
PGRST_DB_URI
=
$POSTGRES_ACCESS
export
PGRST_SERVER_PORT
=
$WEBSERVER_PORT
export
PGRST_ADMIN_SERVER_PORT
=
$ADMIN_PORT
export
PGRST_DB_ROOT_SPEC
=
"home"
postgrest postgrest.conf
}
start_webserver &
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