Skip to content

Commit

Permalink
doc: add steps to create a service
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-vtimofeenko committed Sep 12, 2024
1 parent 0dce6ad commit bc967c2
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,51 @@ machine).
`SHOW ENDPOINTS IN SERVICE <serviceName>`)
3. Open the `ttyd` endpoint URL

# Creating the service

```sql
# If intending to run nix shells:
USE ROLE ACCOUNTADMIN;
CREATE NETWORK RULE nix_cache
TYPE = 'HOST_PORT'
MODE= 'EGRESS'
VALUE_LIST = ('api.github.com', 'codeload.github.com',
'github.com','cache.nixos.org', 'channels.nixos.org');
CREATE EXTERNAL ACCESS INTEGRATION nix_cache_integration
ALLOWED_NETWORK_RULES = (nix_cache)
ENABLED = true;
GRANT USAGE ON INTEGRATION nix_cache_integration TO ROLE <spcsServiceRole>;
USE ROLE <spcsServiceRole>;
CREATE SERVICE <srvName>
IN COMPUTE POOL <computePoolName>
EXTERNAL_ACCESS_INTEGRATIONS = (nix_cache_integration)
FROM SPECIFICATION $$
spec:
containers:
- name: spcs-ttyd
image: /<pathToImageInImageRepo>
command:
- "ttyd"
- "--port=8000"
- "--writable"
- "bash"
env:
PS1: "(webshell-1) bash: "
resources:
limits:
cpu: 0.3
endpoints:
- name: webshell-1
port: 8000
public: true
networkPolicyConfig:
allowInternetEgress: true
$$;
```

# Packages in the container

The container comes with certain tools pre-installed (see the list in [package
Expand Down

0 comments on commit bc967c2

Please sign in to comment.