Skip to content

Commit 7127ccb

Browse files
authored
Merge pull request #18 from postgresml/circleci-project-setup
Add .circleci/config.yml
2 parents b0afb0c + b61881a commit 7127ccb

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed

.circleci/config.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Use the latest 2.1 version of CircleCI pipeline process engine.
2+
# See: https://circleci.com/docs/2.0/configuration-reference
3+
version: 2.1
4+
5+
# Define a job to be invoked later in a workflow.
6+
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
7+
jobs:
8+
red-wine-quality:
9+
# Specify the execution environment. You can specify an image from Dockerhub or use one of our Convenience Images from CircleCI's Developer Hub.
10+
# See: https://circleci.com/docs/2.0/configuration-reference/#docker-machine-macos-windows-executor
11+
docker:
12+
- image: levkk/postgresml:latest
13+
# Add steps to the job
14+
# See: https://circleci.com/docs/2.0/configuration-reference/#steps
15+
steps:
16+
- checkout
17+
- run:
18+
name: "Train and predict"
19+
command: "bash docker/entrypoint.sh psql -U root -p 5432 -h 127.0.0.1 -f sql/test.sql"
20+
21+
# Invoke jobs via workflows
22+
# See: https://circleci.com/docs/2.0/configuration-reference/#workflows
23+
workflows:
24+
end-to-end-tests:
25+
jobs:
26+
- red-wine-quality

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
![PostgresML](./logo-small.png)
44

5+
[![PostgresML](https://circleci.com/gh/postgresml/postgresml/tree/master.svg?style=svg)](https://circleci.com/gh/postgresml/postgresml/tree/master)
6+
57
PostgresML is an end-to-end machine learning system. Using only SQL, it allows to train models and run online predictions, alongside normal queries, directly using the data in your databases.
68

79
## Why

sql/install.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ CREATE EXTENSION IF NOT EXISTS plpython3u;
66
---
77
--- Create schema for models.
88
---
9-
DROP SCHEMA pgml CASCADE;
9+
DROP SCHEMA IF EXISTS pgml CASCADE;
1010
CREATE SCHEMA IF NOT EXISTS pgml;
1111

1212
CREATE OR REPLACE FUNCTION pgml.auto_updated_at(tbl regclass)

sql/test.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ SELECT pgml.version();
88

99
\timing
1010

11-
SELECT pgml.train('Red Wine Scores', 'regression', 'wine_quality_red', 'quality');
11+
SELECT * FROM pgml.train('Red Wine Scores', 'regression', 'wine_quality_red', 'quality');
1212
SELECT pgml.predict('Red Wine Scores', '{7.4, 0.7, 0, 1.9, 0.076, 11, 34, 0.99, 2, 0.5, 9.4}');
1313
SELECT pgml.predict('Red Wine Scores', '{6.4, 0.7, 0, 1.9, 0.076, 11, 34, 0.99, 2, 0.5, 9.4}');
1414
SELECT pgml.predict('Red Wine Scores', '{5.4, 0.7, 0, 1.9, 0.076, 11, 34, 0.99, 2, 0.5, 9.4}');
1515
SELECT pgml.predict('Red Wine Scores', '{3.4, 0.7, 0, 1.9, 0.076, 11, 34, 0.99, 2, 0.5, 9.4}');
1616

17-
SELECT pgml.train('Red Wine Categories', 'classification', 'wine_quality_red', 'quality', 'svm');
17+
SELECT * FROM pgml.train('Red Wine Categories', 'classification', 'wine_quality_red', 'quality', 'svm');
1818
SELECT pgml.predict('Red Wine Categories', '{7.4, 0.7, 0, 1.9, 0.076, 11, 34, 0.99, 2, 0.5, 9.4}');
1919

0 commit comments

Comments
 (0)