GPUCostConsent.tsx 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import React, { useState } from "react";
  2. import styled from "styled-components";
  3. import Button from "./porter/Button";
  4. import ExpandableSection from "./porter/ExpandableSection";
  5. import Fieldset from "./porter/Fieldset";
  6. import Input from "./porter/Input";
  7. import Link from "./porter/Link";
  8. import Spacer from "./porter/Spacer";
  9. import Text from "./porter/Text";
  10. type Props = {
  11. setCurrentStep: (step: string) => void;
  12. markCostConsentComplete: () => void;
  13. };
  14. const GPUCostConsent: React.FC<Props> = ({
  15. setCurrentStep,
  16. markCostConsentComplete,
  17. }) => {
  18. const [confirmCost, setConfirmCost] = useState("");
  19. return (
  20. <>
  21. <Text size={16}>Base AWS cost consent</Text>
  22. <Spacer height="15px" />
  23. <Text color="helper">
  24. Porter will create the underlying infrastructure in your own AWS
  25. account. You will be separately charged by AWS for this infrastructure.
  26. The cost for this base infrastructure is as follows:
  27. </Text>
  28. <Spacer y={1} />
  29. <ExpandableSection
  30. noWrapper
  31. expandText="[+] Show details"
  32. collapseText="[-] Hide details"
  33. Header={<Cost>$224.58 / mo</Cost>}
  34. ExpandedSection={
  35. <>
  36. <Spacer height="15px" />
  37. <Fieldset background="#1b1d2688">
  38. • Amazon Elastic Kubernetes Service (EKS) = $73/mo
  39. <Spacer height="15px" />
  40. • Amazon EC2:
  41. <Spacer height="15px" />
  42. <Tab />+ System workloads: t3.medium instance (2) = $60.74/mo
  43. <Spacer height="15px" />
  44. <Tab />+ Monitoring workloads: t3.large instance (1) = $60.74/mo
  45. <Spacer height="15px" />
  46. <Tab />+ Application workloads: t3.medium instance (1) = $30.1/mo
  47. </Fieldset>
  48. </>
  49. }
  50. />
  51. <Spacer y={1} />
  52. <Text color="helper">
  53. The base AWS infrastructure covers up to 2 vCPU and 4GB of RAM. Separate
  54. from the AWS cost, Porter charges based on your resource usage.
  55. </Text>
  56. <Spacer inline width="5px" />
  57. <Spacer y={0.5} />
  58. <Link hasunderline to="https://porter.run/pricing" target="_blank">
  59. Learn more about our pricing.
  60. </Link>
  61. <Spacer y={0.5} />
  62. <Text color="helper">
  63. You can use your AWS credits to pay for the underlying infrastructure,
  64. and if you are a startup with less than 5M in funding, you may qualify
  65. for our startup program that gives you $10k in credits.
  66. </Text>
  67. <Spacer y={0.5} />
  68. <Link
  69. hasunderline
  70. to="https://gcpjnf9adme.typeform.com/to/vUg9SDWf"
  71. target="_blank"
  72. >
  73. You can apply here.
  74. </Link>
  75. <Spacer y={0.5} />
  76. <Text color="helper">
  77. All AWS resources will be automatically deleted when you delete your
  78. Porter project. Please enter the AWS base cost ("224.58") below to
  79. proceed:
  80. </Text>
  81. <Spacer y={1} />
  82. <Input
  83. placeholder="224.58"
  84. value={confirmCost}
  85. setValue={setConfirmCost}
  86. width="100%"
  87. height="40px"
  88. />
  89. <Spacer y={1} />
  90. <Button
  91. disabled={confirmCost !== "224.58"}
  92. onClick={() => {
  93. setConfirmCost("");
  94. markCostConsentComplete();
  95. setCurrentStep("credentials");
  96. }}
  97. >
  98. Continue
  99. </Button>
  100. </>
  101. );
  102. };
  103. export default GPUCostConsent;
  104. const Cost = styled.div`
  105. font-weight: 600;
  106. font-size: 20px;
  107. `;
  108. const Tab = styled.span`
  109. margin-left: 20px;
  110. height: 1px;
  111. `;