Skip to content

Commit 0b7c246

Browse files
committed
style(pre-commit): various pre-commit based linting changes
1 parent 41776f5 commit 0b7c246

13 files changed

+46
-47
lines changed

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
".": "0.25.0"
3-
}
3+
}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This project has been funded in part by:
3535
Skaha is a general purpose online platform for running science containers interactively. It is part of the [CANFAR Science Platform](https://canfar.net). In the architecture diagram below, skaha is the main API to the Science Platform.
3636

3737
![science-platform-architecture](docs/images/canfar-architecture-2024-04-08.png)
38-
The CANFAR Science Platform Architecture.
38+
The CANFAR Science Platform Architecture.
3939
![canfar-architecture](docs/images/canfar-architecture-1.0.png)
4040
Skaha is the API to the Science Platform box.
4141

@@ -74,4 +74,4 @@ skaha relies on a number of other opencadc modules to operate.
7474
* access control (ac) web service (https://github.com/opencadc/ac) -- If the IdentityManager implementation is configured to use cadc-access-control-server for authentication an operational ac web service is required to be running.
7575
* credential delegation (cdp) web service (https://github.com/opencadc/cdp) -- The cdp service is used to obtain users' delegated proxy certificates.
7676
* cavern -- skaha is complimented by having the cavern VOSpace implementation mounted as a shared POSIX file system. (https://github.com/opencadc/vos/tree/master/cavern). cavern is a vospace implementation where both the data and metadata are based on the contents of a file system. If the software-containers have access to the cavern file system the contents of that file system can be accessed and shared through the cavern web service.
77-
* posix/sssd -- Containers in skaha are always run _as the user_ and with the users' group memberships. If skaha-desktop and software-containers are run with a SSSD configuration that points to the same LDAP instance as used by ac, the names of those uids and gids can be resolved.
77+
* posix/sssd -- Containers in skaha are always run _as the user_ and with the users' group memberships. If skaha-desktop and software-containers are run with a SSSD configuration that points to the same LDAP instance as used by ac, the names of those uids and gids can be resolved.

image-cache/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ This builds a simple image with some formatting tools to support the image cachi
44
to a running Redis cache. See the [cache-images.sh script](https://github.com/opencadc/science-platform/blob/main/deployment/helm/skaha/image-cache/cache-images.sh) in
55
Skaha, which is run from _within_ this Image.
66

7-
See also the [`CronJob` and initialization `Job`](https://github.com/opencadc/science-platform/blob/main/deployment/helm/skaha/templates/image-caching-cronjob.yaml) on how this image is used from a Skaha deployment.
7+
See also the [`CronJob` and initialization `Job`](https://github.com/opencadc/science-platform/blob/main/deployment/helm/skaha/templates/image-caching-cronjob.yaml) on how this image is used from a Skaha deployment.

release-please-config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
}
2323
},
2424
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
25-
}
25+
}

skaha/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ These two kubernetes job configuration files are templates used by skaha to run
6363

6464
## apply version tags
6565
```bash
66-
. VERSION && echo "tags: $TAGS"
66+
. VERSION && echo "tags: $TAGS"
6767
for t in $TAGS; do
6868
docker image tag images.canfar.net/skaha-system/skaha:latest images.canfar.net/skaha-system/skaha:$t
6969
done

skaha/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ minorVersion = 25
1414
# x-release-please-end
1515
# x-release-please-start-patch
1616
patchVersion = 0
17-
# x-release-please-end
17+
# x-release-please-end

skaha/gradlew

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146146
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
147+
# shellcheck disable=SC3045
148148
MAX_FD=$( ulimit -H -n ) ||
149149
warn "Could not query maximum file descriptor limit"
150150
esac
151151
case $MAX_FD in #(
152152
'' | soft) :;; #(
153153
*)
154154
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
155+
# shellcheck disable=SC3045
156156
ulimit -n "$MAX_FD" ||
157157
warn "Could not set maximum file descriptor limit to $MAX_FD"
158158
esac

skaha/src/main/webapp/WEB-INF/web.xml

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
33
<web-app>
44
<display-name>skaha</display-name>
5-
5+
66
<servlet>
77
<servlet-name>logControl</servlet-name>
88
<servlet-class>ca.nrc.cadc.log.LogControlServlet</servlet-class>
@@ -21,18 +21,18 @@
2121
</init-param>
2222
<load-on-startup>1</load-on-startup>
2323
</servlet>
24-
24+
2525
<servlet>
2626
<servlet-name>SessionServlet</servlet-name>
2727
<servlet-class>ca.nrc.cadc.rest.RestServlet</servlet-class>
2828
<init-param>
2929
<param-name>get</param-name>
30-
<param-value>org.opencadc.skaha.session.GetAction</param-value>
30+
<param-value>org.opencadc.skaha.session.GetAction</param-value>
3131
<!-- <param-value>org.opencadc.platform.docker.DockerGet</param-value> -->
3232
</init-param>
3333
<init-param>
3434
<param-name>post</param-name>
35-
<param-value>org.opencadc.skaha.session.PostAction</param-value>
35+
<param-value>org.opencadc.skaha.session.PostAction</param-value>
3636
<!-- <param-value>org.opencadc.platform.docker.DockerPost</param-value> -->
3737
</init-param>
3838
<init-param>
@@ -50,24 +50,24 @@
5050
</init-param>
5151
<load-on-startup>2</load-on-startup>
5252
</servlet>
53-
53+
5454
<servlet>
5555
<servlet-name>ContextServlet</servlet-name>
5656
<servlet-class>ca.nrc.cadc.rest.RestServlet</servlet-class>
5757
<init-param>
5858
<param-name>get</param-name>
59-
<param-value>org.opencadc.skaha.context.GetAction</param-value>
59+
<param-value>org.opencadc.skaha.context.GetAction</param-value>
6060
<!-- <param-value>org.opencadc.platform.docker.DockerGet</param-value> -->
6161
</init-param>
6262
<load-on-startup>2</load-on-startup>
6363
</servlet>
64-
64+
6565
<servlet>
6666
<servlet-name>ImageServlet</servlet-name>
6767
<servlet-class>ca.nrc.cadc.rest.RestServlet</servlet-class>
6868
<init-param>
6969
<param-name>get</param-name>
70-
<param-value>org.opencadc.skaha.image.GetAction</param-value>
70+
<param-value>org.opencadc.skaha.image.GetAction</param-value>
7171
<!-- <param-value>org.opencadc.platform.docker.DockerGet</param-value> -->
7272
</init-param>
7373
<load-on-startup>2</load-on-startup>
@@ -117,17 +117,17 @@
117117
</servlet>
118118

119119
<!-- URL-to-servlet mapping -->
120-
120+
121121
<servlet-mapping>
122122
<servlet-name>SessionServlet</servlet-name>
123123
<url-pattern>/v0/session/*</url-pattern>
124124
</servlet-mapping>
125-
125+
126126
<servlet-mapping>
127127
<servlet-name>ContextServlet</servlet-name>
128128
<url-pattern>/v0/context/*</url-pattern>
129129
</servlet-mapping>
130-
130+
131131
<servlet-mapping>
132132
<servlet-name>ImageServlet</servlet-name>
133133
<url-pattern>/v0/image/*</url-pattern>
@@ -137,23 +137,23 @@
137137
<servlet-name>ImageRepositoryServlet</servlet-name>
138138
<url-pattern>/v0/repository/*</url-pattern>
139139
</servlet-mapping>
140-
140+
141141
<servlet-mapping>
142142
<servlet-name>CapabilitiesServlet</servlet-name>
143143
<url-pattern>/capabilities</url-pattern>
144144
</servlet-mapping>
145-
145+
146146
<servlet-mapping>
147147
<servlet-name>AvailabilityServlet</servlet-name>
148148
<url-pattern>/availability</url-pattern>
149149
</servlet-mapping>
150-
150+
151151
<!-- Log control servlet endpoint -->
152152
<servlet-mapping>
153153
<servlet-name>logControl</servlet-name>
154154
<url-pattern>/logControl</url-pattern>
155155
</servlet-mapping>
156-
156+
157157
<welcome-file-list>
158158
<welcome-file>index.html</welcome-file>
159159
</welcome-file-list>

skaha/src/main/webapp/capabilities.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<accessURL use="full">https://replace.me.com/skaha/availability</accessURL>
1616
</interface>
1717
</capability>
18-
18+
1919
<capability standardID="vos://cadc.nrc.ca~vospace/CADC/std/Logging#control-1.0">
2020
<interface xsi:type="vs:ParamHTTP" role="std" version="1.0">
2121
<accessURL use="full">https://replace.me.com/skaha/logControl</accessURL>
@@ -38,4 +38,3 @@
3838
</capability>
3939

4040
</vosi:capabilities>
41-

skaha/src/main/webapp/service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ paths:
5353
in: query
5454
type: string
5555
description: |
56-
The name for the session (for user informational purposes only).
56+
The name for the session (for user informational purposes only).
5757
required: true
5858
- name: image
5959
in: query

skaha/src/obsolete/java/org/opencadc/arcade/docker/DockerDelete.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@
7373
public class DockerDelete extends DeleteAction {
7474

7575
private static final Logger log = Logger.getLogger(DockerDelete.class);
76-
76+
7777
@Override
7878
public void stopSession(String userID, String sessionID) throws Exception {
7979
// kill the session specified by sessionID
8080
log.debug("Stopping VNC session");
8181
String[] stopVNCCmd = new String[] {"/scripts/docker/stop-desktop.sh", userID, sessionID};
8282
execute(stopVNCCmd);
8383
}
84-
84+
8585
}

skaha/src/obsolete/java/org/opencadc/arcade/docker/DockerGet.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@
7676
import ca.nrc.cadc.util.StringUtil;
7777

7878
public class DockerGet extends GetAction {
79-
79+
8080
private static final Logger log = Logger.getLogger(DockerGet.class);
81-
81+
8282
@Override
8383
public void listSessions() throws Exception {
8484

8585
String[] getVNCSessions = new String[] {"docker", "ps", "--format", "{{.Names}}\\t{{.Status}}", "--filter", "label=canfar-net-userid=" + userID};
8686
String vncSessions = execute(getVNCSessions);
87-
87+
8888
if (StringUtil.hasLength(vncSessions)) {
8989
String[] lines = vncSessions.split("\n");
9090
if (lines.length > 0) {
@@ -120,21 +120,21 @@ public void listSessions() throws Exception {
120120
}
121121
log.debug("No container listing output");
122122
}
123-
123+
124124
protected String parseCID(String vncName) {
125125
String[] parts = vncName.split("_");
126126
String sessionID = parts[parts.length - 2];
127127
return sessionID;
128128
}
129-
129+
130130
protected String parseCURL(String vncName) throws IOException, InterruptedException {
131131
String sessionID = parseCID(vncName);
132132
String[] getIpCmd = new String[] {
133133
"docker", "inspect", "--format", "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}", vncName};
134134
String ipAddress = execute(getIpCmd);
135135
return getVNCURL(server, sessionID, ipAddress);
136136
}
137-
137+
138138
protected String parseCName(String vncName) {
139139
String[] parts = vncName.split("_");
140140
return parts[parts.length - 1];

skaha/src/obsolete/java/org/opencadc/arcade/docker/DockerPost.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@
7979
import ca.nrc.cadc.util.StringUtil;
8080

8181
public class DockerPost extends PostAction {
82-
82+
8383
private static final Logger log = Logger.getLogger(DockerPost.class);
84-
84+
8585
@Override
8686
public void checkForExistingSession(String userid) throws Exception {
8787
String[] getVNCSessions = new String[] {"docker", "ps", "--format", "{{.Names}}\\t{{.Status}}", "--filter", "label=canfar-net-userid=" + userID};
@@ -93,48 +93,48 @@ public void checkForExistingSession(String userid) throws Exception {
9393
}
9494
}
9595
}
96-
96+
9797
@Override
9898
public URL createSession(String sessionID, String name) throws Exception {
9999

100100
String[] runNoVNCCmd = new String[] {"/scripts/docker/run-desktop.sh", userID, sessionID, name, homedir, scratchdir};
101101
String imageID = execute(runNoVNCCmd);
102-
102+
103103
// insert the user's proxy cert on the container
104104
Subject subject = AuthenticationUtil.getCurrentSubject();
105105
//injectProxyCert("/home", subject, userID);
106-
106+
107107
String[] getIpCmd = new String[] {
108108
"docker", "inspect", "--format", "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}", imageID};
109109
String ipAddress = execute(getIpCmd);
110-
110+
111111
// give vnc a few seconds to initialize
112112
try {
113113
log.debug("3 second wait for vnc initialization");
114114
Thread.sleep(2000);
115115
} catch (InterruptedException ignore) {
116116
}
117117
log.debug("wait over");
118-
118+
119119
String redirectPath = super.getVNCURL(server, sessionID, ipAddress);
120120
return new URL(redirectPath);
121121
}
122-
122+
123123
@Override
124124
public void attachSoftware(String software, List<String> params, String targetIP) throws Exception {
125-
125+
126126
confirmSoftware(software);
127-
127+
128128
// only one parameter supported for now
129129
String param = "xterm";
130130
if (params != null && params.size() > 0) {
131131
param = params.get(0);
132132
}
133133
log.debug("Using parameter: " + param);
134-
134+
135135
String[] runAppCmd = new String[] {"/scripts/docker/software.sh", software, targetIP, userID, homedir, scratchdir, param};
136136
String imageID = execute(runAppCmd);
137-
137+
138138
// refresh the user's proxy cert
139139
Subject subject = AuthenticationUtil.getCurrentSubject();
140140
//injectProxyCert("/home", subject, userID);

0 commit comments

Comments
 (0)