Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zombienet-sdk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
zombienet-sdk
Commits
8634df70
Verified
Commit
8634df70
authored
1 year ago
by
Loris Moulin
Browse files
Options
Downloads
Patches
Plain Diff
feat: removed unused types atm and added TransferedFile
parent
89c18828
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
crates/provider/src/shared/types.rs
+3
-182
3 additions, 182 deletions
crates/provider/src/shared/types.rs
with
3 additions
and
182 deletions
crates/provider/src/shared/types.rs
+
3
−
182
View file @
8634df70
use
std
::{
collections
::
HashMap
,
os
::
unix
::
process
::
ExitStatusExt
,
path
::
PathBuf
,
process
::
ExitStatus
,
};
use
serde
::{
Deserialize
,
Serialize
};
pub
type
Port
=
u16
;
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
enum
ZombieRole
{
Temp
,
Node
,
BootNode
,
Collator
,
CumulusCollator
,
Authority
,
FullNode
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
enum
PortName
{
Prometheus
,
Rpc
,
RpcWs
,
P2P
,
}
// TODO: remove when we implement k8s/podman
#[allow(dead_code)]
#[derive(Debug,
Clone,
PartialEq)]
enum
ImagePullPolicy
{
IfNotPresent
,
Never
,
Always
,
}
#[derive(Debug,
Clone,
PartialEq)]
pub
struct
FileMap
{
pub
local_file_path
:
PathBuf
,
pub
remote_file_path
:
PathBuf
,
pub
is_unique
:
bool
,
}
#[derive(Debug,
Clone,
PartialEq)]
pub
struct
RunCommandResponse
{
pub
exit_code
:
ExitStatus
,
pub
std_out
:
String
,
pub
std_err
:
Option
<
String
>
,
}
impl
RunCommandResponse
{
pub
fn
default
()
->
Self
{
Self
{
exit_code
:
ExitStatus
::
from_raw
(
0
),
std_out
:
String
::
default
(),
std_err
:
None
,
}
}
}
#[derive(Debug,
Default,
Clone,
PartialEq)]
pub
struct
NativeRunCommandOptions
{
pub
is_failure_allowed
:
bool
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
NamespaceLabels
{
job_id
:
String
,
project_name
:
String
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
NamespaceMetadata
{
pub
name
:
String
,
pub
labels
:
Option
<
NamespaceLabels
>
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
NamespaceDef
{
pub
api_version
:
String
,
pub
kind
:
String
,
pub
metadata
:
NamespaceMetadata
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
PodLabels
{
pub
zombie_role
:
ZombieRole
,
pub
app
:
String
,
pub
zombie_ns
:
String
,
pub
name
:
String
,
pub
instance
:
String
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
PodMetadata
{
pub
name
:
String
,
pub
namespace
:
String
,
pub
labels
:
PodLabels
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
PodSpec
{
pub
cfg_path
:
String
,
pub
data_path
:
String
,
pub
ports
:
Vec
<
PortInfo
>
,
pub
command
:
Vec
<
String
>
,
pub
env
:
ProcessEnvironment
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
PodDef
{
pub
metadata
:
PodMetadata
,
pub
spec
:
PodSpec
,
}
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
EnvVar
{
pub
(
crate
)
name
:
String
,
pub
(
crate
)
value
:
String
,
}
impl
From
<
(
&
str
,
&
str
)
>
for
EnvVar
{
fn
from
(
value
:
(
&
str
,
&
str
))
->
Self
{
Self
{
name
:
value
.0
.into
(),
value
:
value
.1
.into
(),
}
}
}
type
ProcessEnvironment
=
Vec
<
EnvVar
>
;
#[derive(Debug,
Clone,
PartialEq,
Serialize,
Deserialize)]
pub
struct
PortInfo
{
pub
container_port
:
Port
,
pub
name
:
PortName
,
pub
flag
:
String
,
pub
host_port
:
Port
,
}
#[derive(Debug,
Clone,
PartialEq)]
struct
Volume
{
name
:
String
,
fs_type
:
String
,
mount_path
:
String
,
}
#[derive(Debug,
Clone,
PartialEq)]
pub
struct
Settings
{
volumes
:
Option
<
Vec
<
Volume
>>
,
bootnode
:
Option
<
bool
>
,
bootnode_domain
:
Option
<
String
>
,
timeout
:
u16
,
node_spawn_timeout
:
u16
,
grafana
:
Option
<
bool
>
,
telemetry
:
Option
<
bool
>
,
prometheus
:
Option
<
bool
>
,
/// agent or collator
jaeger_agent
:
Option
<
String
>
,
/// collator query url
tracing_collator_url
:
Option
<
String
>
,
/// only used by k8s provider and if not set the `url`
tracing_collator_service_name
:
Option
<
String
>
,
/// only used by k8s provider and if not set the `url`
tracing_collator_service_namespace
:
Option
<
String
>
,
/// only used by k8s provider and if not set the `url`
tracing_collator_service_port
:
Option
<
u16
>
,
enable_tracing
:
Option
<
bool
>
,
provider
:
String
,
polkadot_introspector
:
Option
<
bool
>
,
/// only used in k8s at the moment, spawn a backchannel instance
backchannel
:
Option
<
bool
>
,
image_pull_policy
:
ImagePullPolicy
,
/// ip used for expose local services (rpc/metrics/monitors)
local_ip
:
Option
<
String
>
,
}
#[derive(Debug,
Clone,
Serialize,
PartialEq)]
pub
struct
Process
{
pub
pid
:
u32
,
pub
logs
:
String
,
pub
port_mapping
:
HashMap
<
u16
,
u16
>
,
pub
command
:
String
,
pub
env
:
ProcessEnvironment
,
pub
struct
TransferedFile
{
pub
local_path
:
String
,
pub
remote_path
:
String
,
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment