Skip to content
Snippets Groups Projects
Unverified Commit d7707c7c authored by Martin Weise's avatar Martin Weise
Browse files

Added seeders

parent f965e3e3
No related branches found
No related tags found
3 merge requests!81New stable release,!43Merge dev to master,!36Resolve "Test AMQP"
Showing
with 157 additions and 664 deletions
{
"name": "Public Transport in Zurich",
"repository": "mariadb",
"tag": "10.5"
}
\ No newline at end of file
{
"action": "START"
}
\ No newline at end of file
{
"description": "Public transport routes and schedules for the city of Zurich",
"is_public": true,
"name": "Public Transport in Zurich"
}
\ No newline at end of file
{
"columns": [
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "linie",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "richtung",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": "dd.MM.yy",
"enum_values": [],
"foreign_key": null,
"name": "betriebsdatum",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "DATE",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fahrzeug",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "kurs",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "seq_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_diva_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_punkt_diva_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_kurz_von1",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": "dd.MM.yy",
"enum_values": [],
"foreign_key": null,
"name": "datum_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "DATE",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "soll_an_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "ist_an_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "soll_ab_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "ist_ab_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "seq_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_diva_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_punkt_diva_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_kurz_nach1",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": "dd.MM.yy",
"enum_values": [],
"foreign_key": null,
"name": "datum_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "DATE",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "soll_an_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "ist_an_nach1",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "soll_ab_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "ist_ab_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fahrt_id",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fahrweg_id",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fw_no",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fw_typ",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fw_kurz",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "fw_lang",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "STRING",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "umlauf_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_id_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_id_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_punkt_id_von",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
},
{
"check_expression": null,
"date_format": null,
"enum_values": [],
"foreign_key": null,
"name": "halt_punkt_id_nach",
"null_allowed": false,
"primary_key": false,
"references": null,
"type": "NUMBER",
"unique": false
}
],
"description": "Public transport routes and schedules for the city of Zurich https://data.stadt-zuerich.ch/dataset/vbz-fahrzeiten-ogd",
"name": "Public Transport in Zurich"
}
#!/bin/bash
GATEWAY="$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' fda-gateway-service):9095"
# fda-container-service
STATUS=$(curl -X POST "http://${GATEWAY}/api/container/" \
-o /dev/null -w "%{http_code}" -s -m 10 -d '@.fda-deployment/fda-container-service/create-container-traffic.json' \
-H "Content-Type: application/json")
if [ "${STATUS}" != 201 ]; then
echo "[ERROR] container create"
echo "${STATUS}"
exit 1
fi
echo "[INFO] Created container"
STATUS=$(curl -X PUT "http://${GATEWAY}/api/container/1" \
-o /dev/null -w "%{http_code}" -s -m 10 -d '@.fda-deployment/fda-container-service/start-container-traffic.json' \
-H "Content-Type: application/json")
if [ "${STATUS}" != 202 ]; then
echo "[ERROR] container start"
echo "${STATUS}"
exit 2
fi
echo "[INFO] Started container"
# fda-database-service
STATUS=$(curl -X POST "http://${GATEWAY}/api/container/1/database" \
-o /dev/null -w "%{http_code}" -s -m 10 -d '@.fda-deployment/fda-database-service/create-database-traffic.json' \
-H "Content-Type: application/json")
if [ "${STATUS}" != 201 ]; then
echo "[ERROR] database create"
echo "${STATUS}"
exit 3
fi
echo "[INFO] Created database"
# fda-table-service
STATUS=$(curl -X POST "http://${GATEWAY}/api/container/1/database/1/table" \
-o /dev/null -w "%{http_code}" -s -m 10 -d '@.fda-deployment/fda-table-service/create-table-traffic.json' \
-H "Content-Type: application/json")
if [ "${STATUS}" != 201 ]; then
echo "[ERROR] table create"
echo "${STATUS}"
exit 4
fi
echo "[INFO] Created table"
# fda-query-service
STATUS=$(curl -X POST "http://${GATEWAY}/api/container/1/database/1/table/1/data?location=%2Ftmp%2Ffahrzeitensollist2017011520170121.csv" \
-o /dev/null -w "%{http_code}" -s -m 10 \
-H "Content-Type: application/json")
if [ "${STATUS}" != 201 ]; then
echo "[ERROR] dataset import"
echo "${STATUS}"
exit 5
fi
echo "[INFO] Imported dataset"
#curl -d '@fda-query-service/create-query-air1.json' -X POST "http://${GATEWAY}/api/database/1/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-air2.json' -X POST "http://${GATEWAY}/api/database/1/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-air3.json' -X POST "http://${GATEWAY}/api/database/1/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-infection1.json' -X POST "http://${GATEWAY}/api/database/2/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-infection2.json' -X POST "http://${GATEWAY}/api/database/2/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-infection3.json' -X POST "http://${GATEWAY}/api/database/2/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-weather1.json' -X POST "http://${GATEWAY}/api/database/3/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-weather2.json' -X POST "http://${GATEWAY}/api/database/3/query" -H "Content-Type: application/json"
#curl -d '@fda-query-service/create-query-weather3.json' -X POST "http://${GATEWAY}/api/database/3/query" -H "Content-Type: application/json"
\ No newline at end of file
......@@ -86,7 +86,7 @@ services:
fda-public:
ipv4_address: 172.29.0.9
environment:
SPRING_PROFILES_ACTIVE: docker
SPRING_PROFILES_ACTIVE: docker,seeder
TZ: Europe/Vienna
ports:
- "9092:9092"
......
......@@ -12,6 +12,8 @@ services:
fda-public:
environment:
TZ: Europe/Vienna
EXCHANGE:
KEY:
volumes:
- /sys/class/thermal:/thermal
- /sys/class/hwmon:/hwmon
......
......@@ -28,7 +28,6 @@ public class AuthTokenFilter extends OncePerRequestFilter {
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
String jwt = parseJwt(request);
log.debug("parsed jwt {}", jwt);
if (jwt != null) {
final UserDetails userDetails = authenticationServiceGateway.validate(jwt);
final UsernamePasswordAuthenticationToken authentication = new UsernamePasswordAuthenticationToken(
......
package at.tuwien.config;
import at.tuwien.seeder.Seeder;
import at.tuwien.seeder.impl.SeederImpl;
import com.google.common.io.Files;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -16,19 +16,11 @@ import java.io.IOException;
@Configuration
public class ReadyConfig {
private final Seeder seeder;
@Value("${fda.ready.path}")
private String readyPath;
@Autowired
public ReadyConfig(Seeder seeder) {
this.seeder = seeder;
}
@EventListener(ApplicationReadyEvent.class)
public void init() throws IOException {
seeder.seed();
Files.touch(new File(readyPath));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment