Skip to content

Commit

Permalink
added codespace config
Browse files Browse the repository at this point in the history
  • Loading branch information
jreadey committed Apr 25, 2024
1 parent 0cc166e commit fad6aa9
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "h5pyd with HSDS",
"hostRequirements": {
"cpus": 4
},
"dockerComposeFile": "docker-compose.yaml",
"updateContentCommand": "python3 -m pip install -r requirements.txt",
"postCreateCommand": "",
"service": "app",
"workspaceFolder": "/workspace",
"forwardPorts": [5101],
"portsAttributes": {
"5101": {"label": "HSDS port", "onAutoForward": "silent"}
},
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker": {}
},
"customizations": {
"codespaces": {
"openFiles": []
},
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter"
]
}
}
}
107 changes: 107 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
version: "3"
services:
app:
image: "mcr.microsoft.com/devcontainers/universal:2"
environment:
- HS_ENDPOINT=http://localhost:5101
- HS_USERNAME=test_user1
- HS_PASSWORD=test
- H5PYD_TEST_FOLDER=/home/test_user1/h5pyd_test/
volumes:
- ..:/workspace:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Runs app on the same network as the SN container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:sn
head:
image: hdfgroup/hsds:master
restart: on-failure
mem_limit: 512m
environment:
- TARGET_SN_COUNT=1
- TARGET_DN_COUNT=4
- NODE_TYPE=head_node
ports:
- 5100
volumes:
- ../.hsds/data:/data
- ../.hsds/config/:/config/
dn1:
image: hdfgroup/hsds:master
restart: on-failure
mem_limit: 1g
environment:
- NODE_TYPE=dn
- ROOT_DIR=/data
ports:
- 6101
depends_on:
- head
volumes:
- ../.hsds/data:/data
- ../.hsds/config/:/config/
links:
- head
dn2:
image: hdfgroup/hsds:master
restart: on-failure
mem_limit: 1g
environment:
- NODE_TYPE=dn
ports:
- 6102
depends_on:
- head
volumes:
- ../.hsds/data:/data
- ../.hsds/config/:/config/
links:
- head
dn3:
image: hdfgroup/hsds:master
restart: on-failure
mem_limit: 1g
environment:
- NODE_TYPE=dn
ports:
- 6103
depends_on:
- head
volumes:
- ../.hsds/data:/data
- ../.hsds/config/:/config/
links:
- head
dn4:
image: hdfgroup/hsds:master
restart: on-failure
mem_limit: 1g
environment:
- NODE_TYPE=dn
ports:
- 6104
depends_on:
- head
volumes:
- ../.hsds/data:/data
- ../.hsds/config/:/config/
links:
- head
sn:
image: hdfgroup/hsds:master
restart: on-failure
mem_limit: 1g
environment:
- SN_PORT=5101
- NODE_TYPE=sn
ports:
- 5101:5101
depends_on:
- head
volumes:
- ../.hsds/data:/data
- ../.hsds/config/:/config/
links:
- head
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ target/

# macOS stuff
.DS_Store

# hsds config
/.hsds/
9 changes: 9 additions & 0 deletions .hsds/config/override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
log_level: DEBUG
bucket_name: hsdstest
server_name: "HSDS for Github codespaces"
aws_region: us-west-2 # (original was us-east-1)
aws_s3_gateway: http://s3.us-west-2.amazonaws.com/ # (original was null)
aws_s3_no_sign_request: True # (original was false)
root_dir: /data


13 changes: 13 additions & 0 deletions .hsds/config/passwd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# HSDS password file template
#
#
# This file contains a list of usernames/passwords that will be used to authenticate
# requests to HSDS.
# If using HTTP Basic Auth, copy file to "passwd.txt" in the same directory before deploying HSDS.
# Otherwise, if using Azure Active Directory or Kerberos, don't copy this file - usernames will be
# authenticated using those identity providers.
# For production use, replace the "test" password below with secret passwords and add
# and any new accounts desired.
admin:admin
test_user1:test
test_user2:test
1 change: 1 addition & 0 deletions .hsds/data/hsdstest/home/.domain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"owner": "admin", "acls": {"admin": {"create": true, "read": true, "update": true, "delete": true, "readACL": true, "updateACL": true}, "default": {"create": false, "read": true, "update": false, "delete": false, "readACL": false, "updateACL": false}}, "created": 1708897646.0599918, "lastModified": 1708897646.0599918}
1 change: 1 addition & 0 deletions .hsds/data/hsdstest/home/test_user1/.domain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"owner": "test_user1", "acls": {"test_user1": {"create": true, "read": true, "update": true, "delete": true, "readACL": true, "updateACL": true}, "default": {"create": false, "read": true, "update": false, "delete": false, "readACL": false, "updateACL": false}}, "created": 1711992550.3733413, "lastModified": 1711992550.3733413}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"owner": "test_user1", "acls": {"test_user1": {"create": true, "read": true, "update": true, "delete": true, "readACL": true, "updateACL": true}, "default": {"create": false, "read": true, "update": false, "delete": false, "readACL": false, "updateACL": false}}, "created": 1711992550.3733413, "lastModified": 1711992550.3733413}
1 change: 1 addition & 0 deletions data/hsdstest/home/test_user1/.domain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"owner": "test_user1", "acls": {"test_user1": {"create": true, "read": true, "update": true, "delete": true, "readACL": true, "updateACL": true}, "default": {"create": false, "read": true, "update": false, "delete": false, "readACL": false, "updateACL": false}}, "created": 1711992550.3733413, "lastModified": 1711992550.3733413}

0 comments on commit fad6aa9

Please sign in to comment.