Skip to content

Commit 62895ad

Browse files
authored
Merge pull request #283 from hubmapconsortium/test-release
v2.0.22 release
2 parents 7a24288 + 1c49861 commit 62895ad

File tree

80 files changed

+6015
-477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+6015
-477
lines changed

OpenAPI3-and-AWS-API-Gateway-Extensions.yaml

Lines changed: 4654 additions & 0 deletions
Large diffs are not rendered by default.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.21
1+
2.0.22

docker/docker-compose.dev.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ version: "3.7"
33
services:
44

55
entity-api:
6+
# Map host machine port 3333 to container port 8080
7+
# Only root can listen on ports below 1024, we use higher-numbered ports
8+
# since nginx is running under non-root user hubmap
9+
ports:
10+
- "3333:8080"
611
environment:
712
- HOST_GID=${HOST_GID:-1000}
813
- HOST_UID=${HOST_UID:-1000}
@@ -14,3 +19,5 @@ services:
1419
- "../BUILD:/usr/src/app/BUILD"
1520
# Mount the source code
1621
- "../src:/usr/src/app/src"
22+
# Mount conf.d on host machine to the nginx conf.d on container
23+
- "./entity-api/nginx/conf.d:/etc/nginx/conf.d"

docker/docker-compose.localhost.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,3 @@ services:
1212
- "../BUILD:/usr/src/app/BUILD"
1313
# Mount the source code to container
1414
- "../src:/usr/src/app/src"
15-
16-
# # Only used for local development
17-
# hubmap-neo4j:
18-
# build: ./hubmap-neo4j
19-
# # Build the image with name and tag
20-
# image: hubmap-neo4j:1.1
21-
# hostname: hubmap-neo4j
22-
# container_name: hubmap-neo4j
23-
# # Use the same port mapping for dev and prod
24-
# ports:
25-
# - "7474:7474"
26-
# - "7687:7687"
27-
# volumes:
28-
# # Mount the neo4j configuration file to container
29-
# - "./hubmap-neo4j/neo4j.conf:/usr/src/app/neo4j/conf/neo4j.conf"
30-
# networks:
31-
# - gateway_hubmap

docker/docker-compose.prod.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ version: "3.7"
33
services:
44

55
entity-api:
6+
# Map host machine port 3333 to container port 8080
7+
# Only root can listen on ports below 1024, we use higher-numbered ports
8+
# since nginx is running under non-root user hubmap
9+
ports:
10+
- "3333:8080"
611
environment:
712
- HOST_GID=${HOST_GID:-1000}
813
- HOST_UID=${HOST_UID:-1000}
914
init: true
1015
restart: always
16+
volumes:
17+
# Mount conf.d on host machine to the nginx conf.d on container
18+
- "./entity-api/nginx/conf.d:/etc/nginx/conf.d"
1119

1220

docker/docker-compose.stage.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ version: "3.7"
33
services:
44

55
entity-api:
6+
# Map host machine port 3333 to container port 8080
7+
# Only root can listen on ports below 1024, we use higher-numbered ports
8+
# since nginx is running under non-root user hubmap
9+
ports:
10+
- "3333:8080"
611
environment:
712
- HOST_GID=${HOST_GID:-1000}
813
- HOST_UID=${HOST_UID:-1000}
914
init: true
1015
restart: always
16+
volumes:
17+
# Mount conf.d on host machine to the nginx conf.d on container
18+
- "./entity-api/nginx/conf.d:/etc/nginx/conf.d"
1119

1220

docker/docker-compose.test.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,17 @@ version: "3.7"
33
services:
44

55
entity-api:
6+
# Map host machine port 3333 to container port 8080
7+
# Only root can listen on ports below 1024, we use higher-numbered ports
8+
# since nginx is running under non-root user hubmap
9+
ports:
10+
- "3333:8080"
611
environment:
712
- HOST_GID=${HOST_GID:-1000}
813
- HOST_UID=${HOST_UID:-1000}
914
init: true
1015
restart: always
16+
volumes:
17+
# Mount conf.d on host machine to the nginx conf.d on container
18+
- "./entity-api/nginx/conf.d:/etc/nginx/conf.d"
1119

docker/docker-compose.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
hostname: entity-api
1616
container_name: entity-api
1717
healthcheck:
18-
test: ["CMD", "curl", "--fail", "http://hubmap-auth:3333"]
18+
test: ["CMD", "curl", "--fail", "http://localhost:8080"]
1919
interval: 1m30s
2020
timeout: 10s
2121
retries: 3
@@ -27,9 +27,6 @@ services:
2727
- "../log:/usr/src/app/log"
2828
# Mount the schema yaml file
2929
- "../src/schema/provenance_schema.yaml:/usr/src/app/src/schema/provenance_schema.yaml"
30-
# Mount the file uploads tmp directory and destination directory
31-
- "/hubmap-data/hm_uploads_tmp:/hubmap-data/hm_uploads_tmp"
32-
- "/hubmap-data/hm_uploads:/hubmap-data/hm_uploads"
3330
networks:
3431
- gateway_hubmap
3532

docker/entity-api/Dockerfile

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,37 @@ WORKDIR /usr/src/app
1313
# Copy from host to image
1414
COPY . .
1515

16-
# Install flask app dependencies with pip (pip3 also works)
17-
RUN pip install -r src/requirements.txt
16+
# Nginx package from EPEL is old, we create a new repository file to install the latest mainline version of Nginx
17+
RUN echo $'[nginx-mainline]\n\
18+
name=nginx mainline repo\n\
19+
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/\n\
20+
gpgcheck=0\n\
21+
enabled=1\n'\
22+
>> /etc/yum.repos.d/nginx.repo
23+
24+
# Reduce the number of layers in image by minimizing the number of separate RUN commands
25+
# 1 - Install nginx (using the custom yum repo specified earlier)
26+
# 2 - Remove the default nginx config file
27+
# 3 - Overwrite the nginx.conf with ours to run nginx as non-root
28+
# 4 - Install flask app dependencies with pip (pip3 also works)
29+
# 5 - Make the start script executable
30+
# 6 - Clean all yum cache
31+
RUN yum install -y nginx && \
32+
rm /etc/nginx/conf.d/default.conf && \
33+
mv nginx.conf /etc/nginx/nginx.conf && \
34+
pip install -r src/requirements.txt && \
35+
chmod +x start.sh && \
36+
yum clean all
1837

1938
# The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime.
2039
# EXPOSE does not make the ports of the container accessible to the host.
21-
EXPOSE 5000
40+
# Here 5000 is for the uwsgi socket, 8080 for nginx
41+
EXPOSE 5000 8080
2242

2343
# Set an entrypoint
2444
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
2545
RUN chmod +x /usr/local/bin/entrypoint.sh
2646

2747
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
2848

29-
# Finally, we run uWSGI with the ini file
30-
CMD [ "uwsgi", "--ini", "/usr/src/app/src/uwsgi.ini" ]
49+
CMD ["./start.sh"]

docker/entity-api/entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ if [ $? -ne 0 ]; then
1717
useradd -r -u $HOST_UID -g $HOST_GID -m hubmap
1818
fi
1919

20+
# When running Nginx as a non-root user, we need to create the pid file
21+
# and give read and write access to /var/run/nginx.pid, /var/cache/nginx, and /var/log/nginx
22+
# In individual nginx *.conf, also don't listen on ports 80 or 443 because
23+
# only root processes can listen to ports below 1024
24+
touch /var/run/nginx.pid
25+
chown -R hubmap:hubmap /var/run/nginx.pid
26+
chown -R hubmap:hubmap /var/cache/nginx
27+
chown -R hubmap:hubmap /var/log/nginx
28+
2029
# Lastly we use gosu to execute our process "$@" as that user
2130
# Remember CMD from a Dockerfile of child image gets passed to the entrypoint.sh as command line arguments
2231
# "$@" is a shell variable that means "all the arguments"

0 commit comments

Comments
 (0)