Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clenimar Souza
attestation-check
Commits
8507294a
Commit
8507294a
authored
May 06, 2021
by
Clenimar Souza
Browse files
initial commit
parents
Pipeline
#1
failed with stages
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitignore
0 → 100644
View file @
8507294a
/target
Cargo.lock
0 → 100644
View file @
8507294a
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "attestation-check"
version = "0.1.0"
Cargo.toml
0 → 100644
View file @
8507294a
[package]
name
=
"attestation-check"
version
=
"0.1.0"
authors
=
[
"Clenimar Souza <clenimar.filemon@gmail.com>"
]
edition
=
"2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
Dockerfile
0 → 100644
View file @
8507294a
FROM
rust:1.49-alpine
AS
builder
RUN
USER
=
root cargo new
--bin
attestation-check
WORKDIR
./attestation-check
COPY
./Cargo.toml ./Cargo.toml
RUN
cargo build
--release
\
&&
rm
src/
*
.rs
COPY
src ./src
RUN
rm
./target/release/deps/attestation_check
*
\
&&
cargo build
--release
FROM
alpine
COPY
--from=builder /attestation-check/target/release/attestation-check /usr/local/bin/attestation-check
ENTRYPOINT
/usr/local/bin/attestation-check
src/main.rs
0 → 100644
View file @
8507294a
use
std
::
env
;
use
std
::
net
::
TcpStream
;
const
CAS_ENV_KEY
:
&
str
=
"SCONE_CAS_ADDR"
;
const
LAS_ENV_KEY
:
&
str
=
"SCONE_LAS_ADDR"
;
fn
main
()
{
// Read environment variables.
let
cas
=
env
::
var
(
CAS_ENV_KEY
)
.expect
(
"ERROR: SCONE_CAS_ADDR must be set"
);
let
las
=
env
::
var
(
LAS_ENV_KEY
)
.expect
(
"ERROR: SCONE_LAS_ADDR must be set"
);
// Try to open a connection.
println!
(
"Connecting to CAS at: {}"
,
cas
);
TcpStream
::
connect
(
format!
(
"{}:18765"
,
cas
))
.expect
(
"Could not connect to CAS"
);
println!
(
"OK: CAS is reachable"
);
println!
(
"Connecting to LAS at: {}"
,
las
);
TcpStream
::
connect
(
format!
(
"{}:18766"
,
las
))
.expect
(
"Could not connect to LAS"
);
println!
(
"OK: LAS is reachable"
);
// Sockets are closed here.
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment